Main Page Cookbook/Overview ImageMeister the jcprops file Licensing Please Vote! Binary Installation & Configuration [ Win · Mac · Nix ] Changes Public API Source Code Main Page Java [ Common · Win · Mac · Nix ] Native Code [ Common · Win · Mac · Nix ] Manifest Native Code Overviews [ Common · Win · Mac · Nix · Strings ] Macros [ General · Native Macros ] Walkthroughs [ Java only · Java and native ] Building [ Win · Mac · Nix ] Distribution Issues

# CStrW

  Represents a Unicode string.

[ Common | Source | Keywords | Summary | Ancestors | All Members | Descendants ]

## Quick Index

  DESCRIPTION
  MACROS

## Class Summary

class CStrW
{
public:

  CStrW( JNIEnv *pEnv, jstring pStr );
  CStrW( Hjava_lang_String *ps );
  CStrW( long len );
  CStrW( const wchar_t *s );
  CStrW( const char *s );
  CStrW( const CStrW *cs );
  ~CStrW();
  Hjava_lang_String *getJString();
  jstring getJString( JNIEnv *pEnv );
  wchar_t *getBuf() const;
  long getLength() const;
  void toUpper();
  void toLower();
  void setBuf( const wchar_t *s );
  void setBuf( const CStrW *cs );
  void ensureCharCapacity( long cap );
  long getCharCapacity() const;
  long getByteCapacity() const;
  void concat( const wchar_t *s );
  void concat( const CStrW *cs );
  BOOL contains( const CStrW *cs ) const;
  BOOL contains( const wchar_t *s ) const;
  BOOL startsWith( const CStrW *cs ) const;
  BOOL startsWith( const wchar_t *s ) const;
  BOOL isEqual( const CStrW *cs ) const;
  BOOL isEqual( const wchar_t *s ) const;
  BOOL isEqualIgnoreCase( const CStrW *cs ) const;
  BOOL isEqualIgnoreCase( const wchar_t *s ) const;
  long replaceFrom( long startIndex, const wchar_t *searchString, const CStrW *csReplace );
  BOOL extractExeFileName( CStrW *csDest );
  void formatInt( const wchar_t *lpszFormat, long num );
  static long countPackedStrings( const CStrW *ps );
  static CStrW *getPackedString( const CStrW *ps, long i );

protected:

}; // CStrW

Back to the top of CStrW

### DESCRIPTION

Represents a Unicode string. This class can be created from a Java string, and a Java string can be created from objects of this class. A set of macros are used to make it easier to work with these objects. See the 'string.html' file for more information.

Back to the top of CStrW

### MACROS

These macros are defined in CString.h, and are defined using CStr, not CStrW

    DECLARESTR(a)
    	Allocates space for a CStr*, and sets it to null

    MAKESTR(a,b)
    	Constructs a CStr from a Java String. If 'a' is null, or if an exception
    	occurs, sets 'theErr' and jumps to 'bail'
    	'a' is the Java string ( JSTRING )
    	'b' is the CStr*

    DELETESTR(a)
    	If 'a' isn't null, calls 'delete' on it.

Back to the top of CStrW

### CStrW( JNIEnv *pEnv, jstring pStr );

Construct from an RNI string. Only available in RNI builds.

    	CStrW( JNIEnv *pEnv, jstring pStr );

Back to the top of CStrW

### CStrW( Hjava_lang_String *ps );

Construct from a JNI String. Only available in JNI builds.

    	CStrW( Hjava_lang_String *ps );

Back to the top of CStrW

### CStrW( long len );

Construct with an internal buffer able to hold 'len' characters

    	CStrW( long len );

Back to the top of CStrW

### CStrW( const wchar_t *s );

Construct from a wchar_t string

    	CStrW( const wchar_t *s );

Back to the top of CStrW

### CStrW( const char *s );

Construct from a C string, converting with MultiByteToWideChar().

    	CStrW( const char *s );

Back to the top of CStrW

### CStrW( const CStrW *cs );

Construct from another CStrW.

    	CStrW( const CStrW *cs );

Back to the top of CStrW

### ~CStrW();

Destructor.

    	virtual	~CStrW();

Back to the top of CStrW

### Hjava_lang_String *getJString();

Convert to an RNI String. Only available in RNI builds.

    	virtual	Hjava_lang_String	*getJString();

Back to the top of CStrW

### jstring getJString( JNIEnv *pEnv );

Convert to a JNI String. Only available in JNI builds.

    	virtual	jstring	getJString( JNIEnv *pEnv );

Back to the top of CStrW

### wchar_t *getBuf() const;

Returns a pointer to the character buffer.

    	virtual	wchar_t	*getBuf() const;

Back to the top of CStrW

### long getLength() const;

Returns the length of the string.

    	virtual	long	getLength() const;

Back to the top of CStrW

### void toUpper();

Converts the string to upper case.

    	virtual	void	toUpper();

Back to the top of CStrW

### void toLower();

Converts the string to lower case.

    	virtual	void	toLower();

Back to the top of CStrW

### void setBuf( const wchar_t *s );

Copies the given string into this object, expanding the internal buffer as necessary.

in s
  The string to copy into this object.

    	virtual	void	setBuf( const wchar_t *s );

Back to the top of CStrW

### void setBuf( const CStrW *cs );

Copies the given string into this object, expanding the internal buffer as necessary.

in cs
  The string to copy into this object.

    	virtual	void	setBuf( const CStrW *cs );

Back to the top of CStrW

### void ensureCharCapacity( long cap );

Ensures that this object's internal buffer can contain the given number of characters.

in cap
  The new number of characters.

    	virtual	void	ensureCharCapacity( long cap );

Back to the top of CStrW

### long getCharCapacity() const;

Returns the number of characters this object's buffer can hold.

    	virtual	long	getCharCapacity() const;

Back to the top of CStrW

### long getByteCapacity() const;

Returns the number of bytes this object's buffer can hold.

    	virtual	long	getByteCapacity() const;

Back to the top of CStrW

### void concat( const wchar_t *s );

Concatenates the given string, expanding the internal buffer as necessary.

in s
  The string to concat.

    	virtual	void	concat( const wchar_t *s );

Back to the top of CStrW

### void concat( const CStrW *cs );

Concatenates the given string, expanding the internal buffer as necessary.

in cs
  The string to concat.

    	virtual	void	concat( const CStrW *cs );

Back to the top of CStrW

### BOOL contains( const CStrW *cs ) const;

Returns TRUE if this string contains 'cs', FALSE otherwise. Case significant.

in cs
  The string to be searched for.

    	virtual	BOOL	contains( const CStrW *cs ) const;

Back to the top of CStrW

### BOOL contains( const wchar_t *s ) const;

Returns TRUE if this string contains 's', FALSE otherwise. Case significant.

in s
  The string to be searched for.

    	virtual	BOOL	contains( const wchar_t *s ) const;

Back to the top of CStrW

### BOOL startsWith( const CStrW *cs ) const;

Returns TRUE if this string starts with the given string, FALSE otherwise.

in cs
  The string to search for.

    	virtual	BOOL	startsWith( const CStrW *cs ) const;

Back to the top of CStrW

### BOOL startsWith( const wchar_t *s ) const;

Returns TRUE if this string starts with the given string, FALSE otherwise.

in s
  The string to search for.

    	virtual	BOOL	startsWith( const wchar_t *s ) const;

Back to the top of CStrW

### BOOL isEqual( const CStrW *cs ) const;

Returns TRUE if this string equals the given string, FALSE otherwise.

in cs
  The string to compare.

    	virtual	BOOL	isEqual( const CStrW *cs ) const;

Back to the top of CStrW

### BOOL isEqual( const wchar_t *s ) const;

Returns TRUE if this string equals the given string, FALSE otherwise.

in s
  The string to compare.

    	virtual	BOOL	isEqual( const wchar_t *s ) const;

Back to the top of CStrW

### BOOL isEqualIgnoreCase( const CStrW *cs ) const;

Returns TRUE if this string equals the given string, FALSE otherwise. Not case sensitive.

in cs
  The string to compare.

    	virtual	BOOL	isEqualIgnoreCase( const CStrW *cs ) const;

Back to the top of CStrW

### BOOL isEqualIgnoreCase( const wchar_t *s ) const;

Returns TRUE if this string equals the given string, FALSE otherwise. Not case sensitive.

in s
  The string to compare.

    	virtual	BOOL	isEqualIgnoreCase( const wchar_t *s ) const;

Back to the top of CStrW

### long replaceFrom( long startIndex, const wchar_t *searchString, const CStrW *csReplace );

Searches for a substring, and, if found, replaces with another string.

in startIndex
  The index in this string at which to start searching.
in searchString
  The string to be searched for.
in csReplace
  If the string is found, it will be replaced with this string.

    	virtual	long	replaceFrom( long startIndex, const wchar_t *searchString, const CStrW *csReplace );

Back to the top of CStrW

### BOOL extractExeFileName( CStrW *csDest );

If this string contains the full path of an .exe file, places it in csDest. Returns TRUE if it succeeds, FALSE otherwise.

out csDest
  Destination of the exe file name.

    	virtual	BOOL	extractExeFileName( CStrW *csDest );

Back to the top of CStrW

### void formatInt( const wchar_t *lpszFormat, long num );

Uses sprintf to write an integer into this string. The string must be at least 10 characters long.

in lpszFormat
  The printf-style format of the integer.
in num
  The integer.

    	virtual	void	formatInt( const wchar_t *lpszFormat, long num );

Back to the top of CStrW

### long countPackedStrings( const CStrW *ps );

Returns the number of strings in the given packed string. See getPackedString for a description of the format of packed strings.

in ps
  The packed string.

    	static	long	countPackedStrings( const CStrW *ps );

Back to the top of CStrW

### CStrW *getPackedString( const CStrW *ps, long i );

Returns a CStrW containing the i'th string in the given packed string. Returns NULL if that string could not be found. A "packed" string consists of a series of null-terminated c strings, followed by a null character. If represents the null character, a packed string containing "a", "b", and "c" looks like: abc The packed string methods are provided for use with such WinAPI routines as GetLogicalDriveStrings()

in ps
  The packed string.
in i
  Which string to return; 0-based.

    	static	CStrW	*getPackedString( const CStrW *ps, long i );

Back to the top of CStrW

## All Members

public:
  Hjava_lang_String *getJString();
  jstring getJString( JNIEnv *pEnv );
  wchar_t *getBuf() const;
  long getLength() const;
  void toUpper();
  void toLower();
  void setBuf( const wchar_t *s );
  void setBuf( const CStrW *cs );
  void ensureCharCapacity( long cap );
  long getCharCapacity() const;
  long getByteCapacity() const;
  void concat( const wchar_t *s );
  void concat( const CStrW *cs );
  BOOL contains( const CStrW *cs ) const;
  BOOL contains( const wchar_t *s ) const;
  BOOL startsWith( const CStrW *cs ) const;
  BOOL startsWith( const wchar_t *s ) const;
  BOOL isEqual( const CStrW *cs ) const;
  BOOL isEqual( const wchar_t *s ) const;
  BOOL isEqualIgnoreCase( const CStrW *cs ) const;
  BOOL isEqualIgnoreCase( const wchar_t *s ) const;
  long replaceFrom( long startIndex, const wchar_t *searchString, const CStrW *csReplace );
  BOOL extractExeFileName( CStrW *csDest );
  void formatInt( const wchar_t *lpszFormat, long num );
  static long countPackedStrings( const CStrW *ps );
  static CStrW *getPackedString( const CStrW *ps, long i );
protected:

Back to the top of CStrW

## Ancestors

Class does not inherit from any other class.

Back to the top of CStrW

## Descendants

Class is not inherited by any others.

Back to the top of CStrW

Generated from source by the Cocoon utilities on Mon May 28 10:10:47 2001 .

Main Page · JConfig · ImageMeister · System Properties Repository · WordMeister · Free Samples · Java Freeware · Contact Us · FAQ · Links

Copyright (c) 1997,1998,1999,2000 Samizdat Productions. All Rights Reserved.
WarpMovie, TileMovie, JConfig, ImageMeister and MovieShredder are Trademarks of Samizdat Productions.