System

Implements general capabilities that are OS dependent. More...

Files

file  CGlobals.h
 Implements option settings for CHAI3D.
 
file  CMutex.h
 Implements support for mutex objects.
 
file  CString.h
 Implements utility functions for manipulating strings.
 
file  CThread.h
 Implements support for handling threads.
 

Classes

class  chai3d::cGenericType
 This class implements an abstract type. More...
 
class  chai3d::cMutex
 This class implements a mutex. More...
 
class  chai3d::cThread
 This class implements support for threads. More...
 

Functions

int chai3d::cStrLength (const char *a_input)
 This function computes the length of an ANSI string. More...
 
std::string chai3d::cGetFilename (const std::string &a_input, const bool a_includeFileExtension=true)
 This function extracts the filename with or without its extension. More...
 
std::string chai3d::cGetFileExtension (const std::string &a_input, const bool a_includeDot=false)
 This function extracts the file extension of a file. More...
 
std::string chai3d::cGetDirectory (const std::string &a_input)
 This function extracts the directory path from the full file path. More...
 
std::string chai3d::cReplaceFileExtension (const std::string &a_input, const std::string &a_extension)
 This function replaces the file extension of a filename with a new extension name. More...
 
std::string chai3d::cStr (const bool a_value)
 This function converts a boolean into a string. More...
 
std::string chai3d::cStr (const int a_value)
 This function converts an integer into a string. More...
 
std::string chai3d::cStr (const unsigned int a_value)
 This function converts an unsigned integer into a string. More...
 
std::string chai3d::cStr (const float a_value, const unsigned int a_precision=2)
 This function converts a float into a string. More...
 
std::string chai3d::cStr (const double a_value, const unsigned int a_precision=2)
 This function converts a double into a string. More...
 
std::string chai3d::cStrToLower (const std::string &a_input)
 This function converts a string to lower case. More...
 

Detailed Description

Function Documentation

int chai3d::cStrLength ( const char *  a_input)

This function computes the length of an ANSI string of up to 255 characters. If the end of the string cannot be found, then -1 is returned as a result.

Parameters
a_inputInput ANSI string. (Pointer to first character).
Returns
Length of input string, otherwise -1.
std::string chai3d::cGetFilename ( const std::string &  a_input,
const bool  a_includeFileExtension 
)

This function discards the path component of a filename and returns the filename itself, optionally including the file extension.

Parameters
a_inputInput string containing path and filename.
a_includeFileExtensionIf true, then file extension is included.
Returns
Filename with or without file extension.
std::string chai3d::cGetFileExtension ( const std::string &  a_input,
const bool  a_includeDot 
)

This function extracts the file extension of a file, optionally include the dot at the beginning of the extension.
Example: .jpg

Parameters
a_inputInput filename string with or without path.
a_includeDotIf true, then include the dot at the beginning of the extension.
Returns
File extension with or without leading dot.
std::string chai3d::cGetDirectory ( const std::string &  a_input)

This function extracts the directory path portion of the source, and include trailing '/'. If there are no '/'s found, then the function returns an empty string.

Parameters
a_inputInput string including directory path and filename.
Returns
Directory path.
std::string chai3d::cReplaceFileExtension ( const std::string &  a_input,
const std::string &  a_extension 
)

This function replaces the file extension of a filename with a new extension name.

Parameters
a_inputInput string including path and filename.
a_extensionNew file extension.
Returns
New path and filename.
std::string chai3d::cStr ( const bool  a_value)

This function converts a boolean into a string.

Parameters
a_valueInput value of type boolean.
Returns
Converted value into string format.
std::string chai3d::cStr ( const int  a_value)

This function converts an integer into a string.

Parameters
a_valueInput value of type integer.
Returns
Converted value into string format.
std::string chai3d::cStr ( const unsigned int  a_value)

This function converts an unsigned integer into a string.

Parameters
a_valueInput value of type unsigned integer.
Returns
Converted value into string format.
std::string chai3d::cStr ( const float  a_value,
const unsigned int  a_precision 
)

This function converts a float into a string.

Parameters
a_valueInput value of type float.
a_precisionNumber of digits displayed after the decimal point.
Returns
Converted value into string format.
std::string chai3d::cStr ( const double  a_value,
const unsigned int  a_precision 
)

This function converts a double into a string.

Parameters
a_valueInput value of type double.
a_precisionNumber of digits displayed after the decimal point.
Returns
Converted value into string format.
std::string chai3d::cStrToLower ( const std::string &  a_input)

This function converts a string into lowercase.

Parameters
a_inputInput string to be converted.
Returns
Converted string.