Namespaces | |
DebugHelpers | |
TextFile | |
Classes | |
class | AutoPtr |
Old AutoPtr class, maintained to support backwards compatibility. More... | |
class | BinaryStream |
Represent an abstract binary stream of data. More... | |
class | BinaryStreamMemory |
Holds binary data in memory only. More... | |
class | Char |
Represents a single Unicode character. More... | |
class | CharAccumulator |
Character accumulator. More... | |
class | CharIterator |
Iterate intelligently inside a string. More... | |
class | Exception |
Base exception class for 3ds Max. More... | |
class | IBailOutBusyProcessManager |
An interface of bailing out the busy processing functions by pressing the 'Esc' key. More... | |
class | IDlgShowingStatusForPolyObj |
A pure virtual interface for Poly Object's UI as dialog Showing Status. More... | |
class | ITipSystem |
An interface of giving users a tip . More... | |
class | MaxString |
Stores all the strings inside CStr and WStr. More... | |
class | MaxStringCast |
A MaxStringCast is used when casting a MaxString to a type. More... | |
class | MaxStringCastCP |
A Utility class for helping to convert to a specified code page. More... | |
class | MaxStringCastUTF8 |
A Utility class for helping to convert to UTF8. More... | |
class | Noncopyable |
Noncopyable is a handy utility mix-in base class that makes any class derived from it non-copyable. More... | |
class | NullDereferenceException |
Thrown when a null pointer is dereferenced. More... | |
class | OutOfRangeException |
Thrown when an out of bounds index is detected. More... | |
class | Path |
Path type - adds path-operation richness over symbol strings. More... | |
class | RunTimeException |
General multi-purpose exception for runtime errors. More... | |
class | ScopedTrace |
A diagnostic class used for tracing. More... | |
struct | StaticAssert |
An assert that works at compile time. More... | |
struct | StaticAssert< true > |
class | StopWatch |
A basic timer tool. More... | |
class | TabOutOfRangeException |
Thrown when an invalid index is passed into Tab::operator[] or Tab::Addr. More... | |
Enumerations | |
enum | BinaryStreamMode { BINARYSTREAM_MODE_READ = 1 << 0, BINARYSTREAM_MODE_WRITE = 1 << 1, BINARYSTREAM_MODE_APPEND = 1 << 2, BINARYSTREAM_MODE_TRUNCATE = 1 << 3, BINARYSTREAM_MODE_CREATE = 1 << 4, BINARYSTREAM_MODE_TEXT = 1 << 5, BINARYSTREAM_MODE_BINARY = 1 << 6, BINARYSTREAM_MODE_EXCLUSIVE = 1 << 7, BINARYSTREAM_MODE_COMMIT = 1 << 8, BINARYSTREAM_MODE_TEMPORARY = 1 << 9, BINARYSTREAM_MODE_DELETE = 1 << 10, BINARYSTREAM_MODE_SEQUENTIAL_SCAN = 1 << 11, BINARYSTREAM_MODE_RANDOM_ACCESS = 1 << 12 } |
Enum describing file open mode options. More... | |
enum | MaxStringDataEncoding { MSDE_CP_UTF16 = 65012, MSDE_CP_ASCII = 65013, MSDE_CP_UCS4 = 65014, MSDE_CP_MASK = 0x0fffffff } |
String encodings used in the MaxString class. More... | |
Functions | |
UtilExport MaxString | VariantToString (const PROPVARIANT *, UINT encoding=CP_ACP, USHORT flags=0) |
Convert a variant into a string. More... | |
UtilExport bool | VariantIsString (const PROPVARIANT *) |
Determine if a variant is already a string. More... | |
UtilExport bool | VariantIsStringVector (const PROPVARIANT *) |
Determine if a variant is a vector of string. More... | |
template<typename T > | |
size_t | VariantToStringVector (const PROPVARIANT *, std::vector< T > &, UINT encoding=CP_ACP) |
Convert a variant into a std::vector. More... | |
template UtilExport size_t | VariantToStringVector< MaxString > (const PROPVARIANT *, std::vector< MaxString > &, UINT encoding) |
template UtilExport size_t | VariantToStringVector< CStr > (const PROPVARIANT *, std::vector< CStr > &, UINT encoding) |
template UtilExport size_t | VariantToStringVector< WStr > (const PROPVARIANT *, std::vector< WStr > &, UINT encoding) |
UtilExport bool | SetStringToVariant (PROPVARIANT *, const char *str, bool clear=true) |
Sets a string inside a variant. More... | |
UtilExport bool | SetStringToVariant (PROPVARIANT *, const wchar_t *str, bool clear=true) |
Sets a string inside a variant. More... | |
UtilExport bool | VariantAddToVector (PROPVARIANT *v, const char *, UINT encoding=CP_ACP) |
Add a string entry at the end of a variant vector. More... | |
UtilExport bool | VariantAddToVector (PROPVARIANT *v, const wchar_t *, UINT encoding=CP_ACP) |
Add a string entry at the end of a variant vector. More... | |
UtilExport bool | VariantAddToVector (PROPVARIANT *v, const PROPVARIANT *, bool give=false, UINT encoding=CP_ACP) |
Add an entry at the end of a variant vector. More... | |
UtilExport bool | DoesVariantContainWideChars (const PROPVARIANT *variant) |
Determine if a variant contains wide-chars. More... | |
UtilExport bool | VariantConvertToUTF16 (PROPVARIANT *destVar, const PROPVARIANT *sourceVar, UINT codePage=CP_ACP) |
Convert a variant to UTF16. More... | |
UtilExport bool | VariantConvertToMBCS (PROPVARIANT *destVar, const PROPVARIANT *sourceVar, UINT codePage=CP_ACP) |
Convert a variant to MBCS. More... | |
MaxString | VariantToString (const VARIANT *v, UINT encoding=CP_ACP, USHORT flags=0) |
MaxString | VariantToString (const PROPVARIANT &v, UINT encoding=CP_ACP, USHORT flags=0) |
MaxString | VariantToString (const VARIANT &v, UINT encoding=CP_ACP, USHORT flags=0) |
bool | VariantIsStringVector (const VARIANT *v) |
bool | VariantIsStringVector (const PROPVARIANT &v) |
bool | VariantIsStringVector (const VARIANT &v) |
size_t | VariantToStringVector (const VARIANT *v, std::vector< MaxString > &ov, UINT encoding=CP_ACP) |
size_t | VariantToStringVector (const PROPVARIANT &v, std::vector< MaxString > &ov, UINT encoding=CP_ACP) |
size_t | VariantToStringVector (const VARIANT &v, std::vector< MaxString > &ov, UINT encoding=CP_ACP) |
UtilExport void | UseLanguagePackLocale (HMODULE hMyModule=reinterpret_cast< HMODULE >(&__ImageBase)) |
Sets the locale for a DLL or thread to match that of the language pack being used at 3ds Max start up. More... | |
UtilExport WORD | GetLanguageID () |
Returns the identifier of the language used by 3ds Max. More... | |
UtilExport LANGID | GetLocaleValue () |
Returns the locale ID value that is being used by 3ds Max, as set by the language pack being used at runtime. More... | |
UtilExport const MCHAR * | GetLocaleValueAsHexString () |
Returns the locale ID value that is being used by 3ds Max, as set by the language pack being used at runtime. More... | |
UtilExport const MCHAR * | GetLanguageTLA () |
Returns the "three letter acronym" (TLA) of the language used by 3ds Max. More... | |
UtilExport const MCHAR * | GetLanguagePackDirName () |
Returns the two-two (eg "en-US" or "ja-JP") language pack directory for the language pack in use by 3ds Max. More... | |
UtilExport UINT | CodePageForLanguage (LANGID) |
Returns the code page corresponding to the specified locale value. More... | |
UtilExport bool | CopyToClipBoard (const MCHAR *text, HWND hwnd) |
copies a string to the system wide clipboard More... | |
UtilExport bool | ScanDirectoryTree (const MCHAR *treeroot, const MCHAR *filename, MSTR &targetpath) |
UtilExport MSTR | CaptureCallStack (int skipFirstNStackLevels=3, int maxStackLevels=-1) |
UtilExport IBailOutBusyProcessManager * | GetBailOutManager () |
UtilExport IDlgShowingStatusForPolyObj * | GetDlgShowingStatusForPolyObj () |
UtilExport BOOL | WritePrivateProfileString (LPCTSTR lpAppName, LPCTSTR lpKeyName, LPCTSTR lpString, LPCTSTR lpFileName) |
These service should replace every occurrence of the standard WIN32 implementation. More... | |
UtilExport BOOL | WritePrivateProfileStruct (LPCTSTR lpszSection, LPCTSTR lpszKey, LPVOID lpStruct, UINT uSizeStruct, LPCTSTR lpFileName) |
Copies data into a key in the specified section of an initialization file. More... | |
UtilExport BOOL | WritePrivateProfileSection (LPCTSTR lpAppName, LPCTSTR lpString, LPCTSTR lpFileName) |
Replaces the keys and values for the specified section in an initialization file. More... | |
TipSystemExport ITipSystem * | GetTipSystem () |
enum BinaryStreamMode |
Enum describing file open mode options.
Enumerator | |
---|---|
BINARYSTREAM_MODE_READ |
Allow reading from a stream. |
BINARYSTREAM_MODE_WRITE |
Allow writing to a stream. |
BINARYSTREAM_MODE_APPEND |
When opened, a stream is positioned at the end. |
BINARYSTREAM_MODE_TRUNCATE |
When opened, the stream is truncated. |
BINARYSTREAM_MODE_CREATE |
If the underlying file doesn't exist, it will create it. |
BINARYSTREAM_MODE_TEXT |
Specify that the underlying data should be interpreted as text. Technically, BinaryStream doesn't do anything with that flag. It's was made to use in conjunction with TextFile::Reader and TextFile::Writer. |
BINARYSTREAM_MODE_BINARY |
Specify that the underlying data should be considered binary. |
BINARYSTREAM_MODE_EXCLUSIVE |
By default, when a file is opened, another process always have the possibility to open the same file concurrently for reading. When this flag is present, it will prevent another process to to open it. |
BINARYSTREAM_MODE_COMMIT |
Write operations will not go through any intermediate cache, they will go directly to disk. |
BINARYSTREAM_MODE_TEMPORARY |
The file is being used for temporary storage. |
BINARYSTREAM_MODE_DELETE |
The file is to be deleted immediately after all of its handles are closed. |
BINARYSTREAM_MODE_SEQUENTIAL_SCAN |
Access is intended to be sequential from beginning to end. |
BINARYSTREAM_MODE_RANDOM_ACCESS |
Access is intended to be random. |
String encodings used in the MaxString class.
In addition to the standard Windows constants like CP_ACP, CP_UTF8, etc... The following constants can also be used as encoding.
UtilExport MaxString MaxSDK::Util::VariantToString | ( | const PROPVARIANT * | , |
UINT | encoding = CP_ACP , |
||
USHORT | flags = 0 |
||
) |
Convert a variant into a string.
For flags, see VariantConvertType inside MSDN for a list of possible values.
UtilExport bool MaxSDK::Util::VariantIsString | ( | const PROPVARIANT * | ) |
Determine if a variant is already a string.
UtilExport bool MaxSDK::Util::VariantIsStringVector | ( | const PROPVARIANT * | ) |
Determine if a variant is a vector of string.
size_t MaxSDK::Util::VariantToStringVector | ( | const PROPVARIANT * | , |
std::vector< T > & | , | ||
UINT | encoding = CP_ACP |
||
) |
Convert a variant into a std::vector.
template UtilExport size_t MaxSDK::Util::VariantToStringVector< MaxString > | ( | const PROPVARIANT * | , |
std::vector< MaxString > & | , | ||
UINT | encoding | ||
) |
template UtilExport size_t MaxSDK::Util::VariantToStringVector< CStr > | ( | const PROPVARIANT * | , |
std::vector< CStr > & | , | ||
UINT | encoding | ||
) |
template UtilExport size_t MaxSDK::Util::VariantToStringVector< WStr > | ( | const PROPVARIANT * | , |
std::vector< WStr > & | , | ||
UINT | encoding | ||
) |
UtilExport bool MaxSDK::Util::SetStringToVariant | ( | PROPVARIANT * | , |
const char * | str, | ||
bool | clear = true |
||
) |
Sets a string inside a variant.
str | String. Copied inside this object. |
clear | If true, will perform a VariantClear on the variant. |
UtilExport bool MaxSDK::Util::SetStringToVariant | ( | PROPVARIANT * | , |
const wchar_t * | str, | ||
bool | clear = true |
||
) |
Sets a string inside a variant.
str | String. Copied inside this object. |
clear | If true, will perform a VariantClear on the variant. |
UtilExport bool MaxSDK::Util::VariantAddToVector | ( | PROPVARIANT * | v, |
const char * | , | ||
UINT | encoding = CP_ACP |
||
) |
Add a string entry at the end of a variant vector.
Supported variant types are:
UtilExport bool MaxSDK::Util::VariantAddToVector | ( | PROPVARIANT * | v, |
const wchar_t * | , | ||
UINT | encoding = CP_ACP |
||
) |
Add a string entry at the end of a variant vector.
Supported variant types are:
UtilExport bool MaxSDK::Util::VariantAddToVector | ( | PROPVARIANT * | v, |
const PROPVARIANT * | , | ||
bool | give = false , |
||
UINT | encoding = CP_ACP |
||
) |
Add an entry at the end of a variant vector.
Supported variant types are:
UtilExport bool MaxSDK::Util::DoesVariantContainWideChars | ( | const PROPVARIANT * | variant | ) |
Determine if a variant contains wide-chars.
UtilExport bool MaxSDK::Util::VariantConvertToUTF16 | ( | PROPVARIANT * | destVar, |
const PROPVARIANT * | sourceVar, | ||
UINT | codePage = CP_ACP |
||
) |
Convert a variant to UTF16.
No matter what happens, the source variant is left intact. And you have the responsability to free the destination variant.
destVar | The destination variant. |
sourceVar | The source variant. |
codePage | Any data stored in "sourceVar" is considered in that codepage. |
UtilExport bool MaxSDK::Util::VariantConvertToMBCS | ( | PROPVARIANT * | destVar, |
const PROPVARIANT * | sourceVar, | ||
UINT | codePage = CP_ACP |
||
) |
Convert a variant to MBCS.
No matter what happens, the source variant is left intact. And you have the responsability to free the destination variant.
destVar | The destination variant. |
sourceVar | The source variant. |
codePage | Any data stored in "sourceVar" is considered to be in ACP. Codepage serves as a destination codepage. All ACP data will be converted to that codepage. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
UtilExport void MaxSDK::Util::UseLanguagePackLocale | ( | HMODULE | hMyModule = reinterpret_cast< HMODULE >(&__ImageBase) | ) |
Sets the locale for a DLL or thread to match that of the language pack being used at 3ds Max start up.
This method must be called as soon as possible in the start up sequence of any DLL that may use localized resources, that is, in the DllMain() call in the DLL_PROCESS_ATTACH execution block.
As for threads, this method must be called as early as possible in the routine indicated in _beginthread() or _beginthreadex()'s start address parameter. Other thread launch calls most likely allow the thread to inherit the value set in DllMain(), but it would be a good precaution to not rely on this mechanism and instead call the method, as there is no harm in calling it more than once.
Calling this method is required in the cases above in order that 3ds Max loads files and Win32 resources from a satellite DLL installed by a language pack that may not match the locale of the OS when running in Vista or higher. Otherwise, the product might run with localized resources retrieved from different satellite DLL sets, resulting in a mix of different languages and/or different locale settings.
However, if localized resources are not handled by the binary in question, or the binary is unilingual (ie usually that means 'English only'), then this call is probably not required. This call is meant to be used with Microsoft's MUI technology, but not exclusively.
This method complements the other locale and language retrieval functions in the MaxSDK.
The hMyModule param is used internally for tracking the loading of dlls for debugging purposes, and should not be specified.
UtilExport WORD MaxSDK::Util::GetLanguageID | ( | ) |
Returns the identifier of the language used by 3ds Max.
This method complements MaxSDK::Util::GetLanguageTLA.
The language identifier is made up of a primary language identifier and a sublanguage identifier, both of which are from a set pre-defined identifiers that are part of the Windows Platform SDK.
For more information on language identifiers see National Language Support (on MSDN)
UtilExport LANGID MaxSDK::Util::GetLocaleValue | ( | ) |
Returns the locale ID value that is being used by 3ds Max, as set by the language pack being used at runtime.
It is returned as a LANGID (WORD). Ex: 409 (in hex) is what it will return for English-United States.
UtilExport const MCHAR* MaxSDK::Util::GetLocaleValueAsHexString | ( | ) |
Returns the locale ID value that is being used by 3ds Max, as set by the language pack being used at runtime.
It is returned as a string. Ex: "409" (without the quotes) is what it will return for English-United States.
UtilExport const MCHAR* MaxSDK::Util::GetLanguageTLA | ( | ) |
Returns the "three letter acronym" (TLA) of the language used by 3ds Max.
This method complements MaxSDK::Util::GetLanguageID. For more information on TLA see List of Windows XP's Three Letter Acronyms for Languages
UtilExport const MCHAR* MaxSDK::Util::GetLanguagePackDirName | ( | ) |
Returns the two-two (eg "en-US" or "ja-JP") language pack directory for the language pack in use by 3ds Max.
This method complements MaxSDK::Util::GetLanguageID.
UtilExport UINT MaxSDK::Util::CodePageForLanguage | ( | LANGID | ) |
Returns the code page corresponding to the specified locale value.
Returns code page for GetLanguageID() if the locale value is not valid. To get the locale value for the code page use GetLocaleValue()
UtilExport bool MaxSDK::Util::CopyToClipBoard | ( | const MCHAR * | text, |
HWND | hwnd | ||
) |
copies a string to the system wide clipboard
text | - The string to copy |
hwnd | - The Window that owns the original information to be copied |
UtilExport bool MaxSDK::Util::ScanDirectoryTree | ( | const MCHAR * | treeroot, |
const MCHAR * | filename, | ||
MSTR & | targetpath | ||
) |
UtilExport MSTR MaxSDK::Util::CaptureCallStack | ( | int | skipFirstNStackLevels = 3 , |
int | maxStackLevels = -1 |
||
) |
UtilExport IBailOutBusyProcessManager* MaxSDK::Util::GetBailOutManager | ( | ) |
UtilExport IDlgShowingStatusForPolyObj* MaxSDK::Util::GetDlgShowingStatusForPolyObj | ( | ) |
UtilExport BOOL MaxSDK::Util::WritePrivateProfileString | ( | LPCTSTR | lpAppName, |
LPCTSTR | lpKeyName, | ||
LPCTSTR | lpString, | ||
LPCTSTR | lpFileName | ||
) |
These service should replace every occurrence of the standard WIN32 implementation.
The WIN32 implementation specifies that when the file name contains UNICODE character, the file will be created with a UNICODE BOM. This is ABSOLUTLY INCORRECT!!! In order to properly save UNICODE INI file, we need to enforce that every INI file has a BOM token. Copies a string into the specified section of an initialization file. This service will create the new INI file with a UTF-16LE and delegate to WIN32 implementation to actually write the new key value pair. If the INI file exist and is not a UNICODE file, it will be re-created as a UTF-16LE and the key|value pair will be written in the proper section.
lpAppName | The name of the section to which the string will be copied. If the section does not exist, it is created. The name of the section is case-independent; the string can be any combination of uppercase and lowercase letters. |
lpKeyName | The name of the key to be associated with a string. If the key does not exist in the specified section, it is created. If this parameter is NULL, the entire section, including all entries within the section, is deleted. |
lpString | A null-terminated string to be written to the file. If this parameter is NULL, the key pointed to by the lpKeyName parameter is deleted. |
lpFileName | The name of the initialization file. |
UtilExport BOOL MaxSDK::Util::WritePrivateProfileStruct | ( | LPCTSTR | lpszSection, |
LPCTSTR | lpszKey, | ||
LPVOID | lpStruct, | ||
UINT | uSizeStruct, | ||
LPCTSTR | lpFileName | ||
) |
Copies data into a key in the specified section of an initialization file.
As it copies the data, the function calculates a checksum and appends it to the end of the data.
lpszSection | The name of the section to which the string will be copied. If the section does not exist, it is created. The name of the section is case independent, the string can be any combination of uppercase and lowercase letters. |
lpszKey | The name of the key to be associated with a string. If the key does not exist in the specified section, it is created. If this parameter is NULL, the entire section, including all keys and entries within the section, is deleted. |
lpStruct | The data to be copied. If this parameter is NULL, the key is deleted. |
uSizeStruct | The size of the buffer pointed to by the lpStruct parameter, in bytes. |
lpFileName | The name of the initialization file. |
UtilExport BOOL MaxSDK::Util::WritePrivateProfileSection | ( | LPCTSTR | lpAppName, |
LPCTSTR | lpString, | ||
LPCTSTR | lpFileName | ||
) |
Replaces the keys and values for the specified section in an initialization file.
lpAppName | The name of the section in which data is written. This section name is typically the name of the calling application. |
lpString | The new key names and associated values that are to be written to the named section. This string is limited to 65,535 bytes. |
lpFileName | The name of the initialization file. If this parameter does not contain a full path for the file, the function searches the Windows directory for the file. If the file does not exist and lpFileName does not contain a full path, the function creates the file in the Windows directory. If the file exists and was created using Unicode characters, the function writes Unicode characters to the file. Otherwise, the function creates a file using ANSI characters. |
TipSystemExport ITipSystem* MaxSDK::Util::GetTipSystem | ( | ) |