[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

 

LStr255



Overview:

LStr255 is a PowerPlant class that is used for Pascal-style strings, having a maximum of 255 characters.

Methods :

The methods in this class are:

 

LStr255()  
LStr255(const LStr255&)  
LStr255(const LString&)  
LStr255(const unsigned char*)  
LStr255(unsigned char)  
LStr255(char)  
LStr255(const char*)  
LStr255(const void*,unsigned char)  
LStr255(char**)  
LStr255(short,short)  
LStr255(long)  
LStr255(long double,signed char,short)  
LStr255(unsigned long)  
operator=()  

Data Members:

The data members in this class are:

 

mString  
 

Operation:

Use these constructors to create and convert strings into 255-character Pascal strings.

Source files:

(Support Classes)

LString.h

LString.cp

Ancestors:

LString

LStr255()

Purpose:

This is the default constructor.

Access:

Public

Prototype:

LStr255();
Parameters:

None

LStr255(const LStr255&)

Purpose:

.Copy constructor.

Access:

Public

Prototype:

LStr255( const LStr255& inOriginal );
Parameters:

This constructor takes the following parameter:

 

const LStr255&  
inOriginal  
The string to copy.  

LStr255(const LString&)

Purpose:

Copy constructor

Access:

Public

Prototype:

LStr255( const LString& inOriginal );
Parameters:

This constructor takes the following parameter:

 

const LString&  
inOriginal  
The string to copy.  

LStr255(const unsigned char*)

Purpose:

Constructor to convert from a pointer to a string.

Access:

Public

Prototype:

LStr255( ConstStringPtr inStringPtr );
Parameters:

This constructor takes the following parameter:

 

ConstStringPtr  
inStringPtr  
The pointer to convert.  

LStr255(unsigned char)

Purpose:

Constructor to make a string from a single character.

Access:

Public

Prototype:

LStr255( UInt8 inChar );
Parameters:

This constructor takes the following parameter:

 

UInt8  
inChar  
The character to convert.  

LStr255(char)

Purpose:

Constructor to make a string from a single character.

Access:

Public

Prototype:

LStr255( char inChar );
Parameters:

This constructor takes the following parameter:

 

char  
inChar  
The character to convert.  

LStr255(const char*)

Purpose:

Constructor to make a string from a C string (null terminated).

Access:

Public

Prototype:

LStr255( const char* inCString );
Parameters:

This constructor takes the following parameter:

 

const char*  
inCString  
The string to convert.  

LStr255(const void*,unsigned char)

Purpose:

Constructor to make a string from a pointer and length.

Access:

Public

Prototype:

LStr255( const void* inPtr, UInt8 inLength );
Parameters:

This constructor takes the following parameters:

 

const void*  
inPtr  
The pointer to convert.  
UInt8  
inLength  
The length of the string data in the pointer.  

LStr255(char**)

Purpose:

Constructor to make a string from the data in a handle.

Access:

Public

Prototype:

LStr255( Handle inHandle );
Parameters:

This constructor takes the following parameter:

 

Handle  
inHandle  
The handle to convert.  

LStr255(short,short)

Purpose:

Constructor to make a string from a resource.

Access:

Public

Prototype:

LStr255( ResIDT inResID, SInt16 inIndex );
Parameters:

This constructor takes the following parameters:

 

ResIDT  
inResID  
The resource ID containing the string.  
SInt16  
inIndex  
The index into the string resource ID.  

LStr255(long)

Purpose:

Constructor to make a string from a long integer.

Access:

Public

Prototype:

LStr255( SInt32 inNumber );
Parameters:

This constructor takes the following parameter:

 

SInt32  
inNumber  
The long integer to create a string from.  

LStr255(long double,signed char,short)

Purpose:

Assignment to create a string from floating point number.

Access:

Public

Prototype:

LStr255( double_t inNumber, SInt8 inStyle,
SInt16 inDigits );
Parameters:

This constructor takes the following parameters:

 

double_t  
inNumber  
The double to create a string from.  
SInt8  
inStyle  
The style to use, must be FLOATDECIMAL or FIXEDDECIMAL.  
SInt16  
inDigits  
  • For FLOATDECIMAL, inDigits is the number of significant digits (should be > 0).
  • For FIXEDDECIMAL, inDigits is the number of digits to the right of the decimal point.

LStr255(unsigned long)

Purpose:

Constructor to create a string from a four character code, which is an unsigned long, the same as ResType and OSType.

Access:

Public

Prototype:

LStr255( FourCharCode inCode );
Parameters:

This constructor takes the following parameter:

 

FourCharCode  
inCode  
The 4-character code to put in the string.  

operator=()

Purpose:

The assignment operator performs typecasting on strings.

Access:

Public

Prototype:

LStr255& operator=( FourCharCode inCode );

LStr255& operator=( SInt32 inNumber );

LStr255& operator=( const char* inCString );

LStr255& operator=( char inChar );

LStr255& operator=( UInt8 inChar );

LStr255& operator=( ConstStringPtr inStringPtr );

LStr255& operator=( const LString& inString );
Parameters:

This operator takes the following parameters:

 

FourCharCode  
inCode  
The 4-character code to put in the string.  
SInt32  
inNumber  
The number to put in the string.  
const char*  
inCString  
The "C" string to convert.
char  
inChar  
The character to make a string from.
UInt8  
inChar  
The character to make a string from.
ConstStringPtr  
inStringPtr  
The string pointer to make a string from.
const LString&  
inString  
The LString to make a string from.

Return:

A reference to an LStr255.

mString

Purpose:

String storage.

Access:

Private

Prototype:

Str255 mString;

 


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: July 21, 2000