Mobile API Reference
MicroStrategy 2019
|
Classes | |
class | Allocator |
class | Allocator< void > |
class | Buffer |
class | BufferException |
class | BufferImplementation |
class | ContractManagerAllocException |
class | DeleteArray |
class | DeleteC |
class | DeleteFS |
class | DeleteOperatorGeneric |
class | Destroy |
class | DSSStrongPtr |
class | ExceptionImpl |
class | FragmentedString |
class | GUID |
class | MemoryContract |
class | Message |
class | ModuleMainPtr |
class | NoCopy |
class | ObjectScopeGuardImpl0 |
class | ObjectScopeGuardImpl1 |
class | ObjectScopeGuardImpl2 |
class | ReferenceCounted |
class | ReturnPtr |
class | ReturnPtrI |
class | ReturnString |
class | ReturnUString |
class | ReturnWString |
class | ScopeGuardImpl0 |
class | ScopeGuardImpl1 |
class | ScopeGuardImpl2 |
class | ScopeGuardImpl3 |
class | ScopeGuardImpl4 |
class | ScopeGuardImplBase |
class | SimpleBuffer |
class | SmartPtrI |
class | SpinLock |
class | StringConversionException |
class | StrongArrayPtr |
class | StrongBase |
class | StrongBufferPtr |
class | StrongObj |
class | StrongPtr |
class | Timer |
class | TMD5 |
class | TotalTimer |
class | TUUID |
Typedefs | |
typedef std::basic_string< WCHAR, std::char_traits< WCHAR >, Allocator< WCHAR > > | String |
typedef StrongPtr< Buffer, DeleteOperatorGeneric< Buffer > > | BufferPtr |
typedef MBase::StrongPtr< FragmentedString, DeleteFS< FragmentedString > > | FragmentedStringPtr |
typedef unsigned short | LanguageID |
typedef unsigned Int32 | ErrorCode |
typedef Int32 | MessageID |
typedef unsigned short | MessageDomain |
typedef void(* | VoidFuncPtr_t) () |
typedef long long | Long64_t |
typedef unsigned long long | ULong64_t |
typedef const ScopeGuardImplBase & | ScopeGuard |
typedef Message | BaseException |
typedef MBase::SmartPtrI< MemoryContract > | MemoryContractPtr |
typedef std::string | CString |
Functions | |
template<class _Ty , class _UT > | |
bool | operator== (const Allocator< _Ty > &left, const Allocator< _UT > &right) |
template<class _Ty , class _UT > | |
bool | operator!= (const Allocator< _Ty > &left, const Allocator< _UT > &right) |
DLL_BASE_EXIM ReturnWString | ASCIIToWideChar (const char *ipASCII, bool ibUseSubstitutionCharacter=false) |
DLL_BASE_EXIM ReturnString | WideCharToASCII (const wchar_t *ipWide, bool ibUseSubstitutionCharacter=false) |
long | AtomicExchange (long &irVariable, long iNewValue) |
DLL_BASE_EXIM Buffer * | CreateBuffer (Int32 iSize, Int32 iExtSize, Int32 iBlkSize=Buffer::NT_BLOCK_SIZE, bool ibOnPageBoundary=false) |
throws ContractManagerException (defined in BaseMemoryContract.h) More... | |
DLL_BASE_EXIM Buffer * | CreateBuffer (Int32 iSize, Int32 iExtSize, MBase::MemoryContract *ipMemoryContract, Int32 iBlkSize=Buffer::NT_BLOCK_SIZE, bool ibOnPageBoundary=false) |
throws ContractManagerException (defined in BaseMemoryContract.h) More... | |
DLL_BASE_EXIM FragmentedString * | CreateFragmentedString (WCHAR *ipStr, size_t iSize, const MBase::Allocator< WCHAR > &iAlloc=MBase::Allocator< WCHAR >()) |
DLL_BASE_EXIM FragmentedString * | CreateFragmentedString (WCHAR *ipStr, const MBase::Allocator< WCHAR > &iAlloc=MBase::Allocator< WCHAR >()) |
bool | IsGUIDNULL (const ::GUID &irGUID) |
bool | IsEqualGUID (const ::GUID &irGUID1, const ::GUID &irGUID2) |
int | CompareGUID (const ::GUID &irGUID1, const ::GUID &irGUID2) |
bool | operator== (const ::GUID &irGUID1, const ::GUID &irGUID2) |
bool | operator!= (const ::GUID &irGUID1, const ::GUID &irGUID2) |
void | CreateGUID (::GUID &orGUID) |
bool | operator< (const ::GUID &irGUID1, const ::GUID &irGUID2) |
unsigned char | WideChar2Digit (WCHAR iChar) |
template<class T > | |
bool | StringToT (T &orT, const WCHAR *i_str) |
bool | String2Guid (::GUID &orGUID, const WCHAR *ipcString) |
bool | String2Guid (::GUID &orGUID, const char *ipString) |
DLL_BASE_EXIM ReturnWString | Guid2String (const ::GUID &irGUID) |
DLL_BASE_EXIM bool | MSString2Guid (::GUID &orGuid, const WCHAR *ipString) |
DLL_BASE_EXIM ReturnWString | Guid2MSString (const ::GUID &irGuid) |
LanguageID | GetPrimaryLanguageID (LanguageID iLanguageID) |
LanguageID | MakeLanguageID (LanguageID iPrimaryLanguageID, LanguageID iSubLanguageID) |
DLL_BASE_EXIM ErrorCode | GetLastError () throw () |
DLL_BASE_EXIM ReturnWString | GetSystemErrorDescription (ErrorCode iErrorCode) throw () |
DLL_BASE_EXIM bool | IsSystemError (ErrorCode iErrorCode) throw () |
DLL_BASE_EXIM const char * | ToString (MBase::MessageDomain iDomain) |
DLL_BASE_EXIM MBase::MessageDomain | ToMessageDomain (const char *ipDomain) |
DLL_BASE_EXIM ReturnWString | MultiByteToWideChar (const char *ipMultiByte, bool ibUseSubstitutionCharacter=false) |
DLL_BASE_EXIM ReturnString | WideCharToMultiByte (const WCHAR *ipWide, bool ibUseSubstitutionCharacter=false) |
bool | operator== (const TMD5 &m1, const TMD5 &m2) |
bool | operator== (const TUUID &u1, const TUUID &u2) |
bool | operator!= (const TUUID &u1, const TUUID &u2) |
ReturnWString DLL_BASE_EXIM | WideChar2String (WCHAR iWideChar) |
DLL_BASE_EXIM ReturnWString | Binary2String (void *ipBin, Int32 iSize) |
DLL_BASE_EXIM ReturnWString | Binary2OctString (void *ipBin, Int32 iSize) |
DLL_BASE_EXIM ReturnWString | ToDecimalWString (int iValue) |
DLL_BASE_EXIM ReturnString | ToDecimalString (int iValue) |
DLL_BASE_EXIM ReturnWString | ToHexUpperWString (int iValue) |
DLL_BASE_EXIM ReturnString | ToHexUpperString (int iValue) |
DLL_BASE_EXIM ReturnWString | ToHexLowerWString (int iValue) |
DLL_BASE_EXIM ReturnString | ToHexLowerString (int iValue) |
DLL_BASE_EXIM int | DecimalToInt (const WCHAR *ipStr) |
DLL_BASE_EXIM int | DecimalToInt (const char *ipStr) |
DLL_BASE_EXIM double | LocaleNeutralStringToDouble (const WCHAR *ipValueString) |
DLL_BASE_EXIM unsigned int | HexToUnsignedInt (const WCHAR *ipStr, bool iIgnoreTrailingCharacters=false) |
DLL_BASE_EXIM unsigned int | HexToUnsignedInt (const char *ipStr, bool iIgnoreTrailingCharacters=false) |
DLL_BASE_EXIM ReturnWString | GetStandardCLibraryErrorDescriptionOrNULL (int iErrorCode) throw () |
DLL_BASE_EXIM ReturnString | GetStandardCLibraryErrorSymbolOrNULL (int iErrorCode) throw () |
DLL_BASE_EXIM ReturnString | GetStandardCLibraryErrorSymbolOrDecimalString (int iErrorCode) throw () |
DLL_BASE_EXIM ReturnWString | GetSignalDescriptionOrNULL (int iSignalNumber) throw () |
DLL_BASE_EXIM ReturnString | GetSignalNameOrNULL (int iSignalNumber) throw () |
DLL_BASE_EXIM ReturnString | GetSignalNameOrDecimalString (int iSignalNumber) throw () |
DLL_BASE_EXIM Int64 | DecimalToInt64 (const wchar_t *ipStr) |
DLL_BASE_EXIM Int64 | DecimalToInt64 (const char *ipStr) |
DLL_BASE_EXIM void | OutputDebugString (const WCHAR *ipDebugString) throw () |
DLL_BASE_EXIM void | OutputDebugString (const char *ipDebugString) throw () |
DLL_BASE_EXIM MBase::ReturnWString | GetEnvironmentVariableOrNULL (const WCHAR *ipVariableName) |
DLL_BASE_EXIM MBase::ReturnWString | ReadEnvironmentVariable (const WCHAR *ipVariableName) |
DLL_BASE_EXIM unsigned Int32 | GetCurrentProcessID () |
DLL_BASE_EXIM ReturnWString | GetComputerName () |
DLL_BASE_EXIM Int32 | GetUniqueMachineID () |
DLL_BASE_EXIM const char * | GetProcessLocale () throw () |
DLL_BASE_EXIM unsigned Int32 | GetCurrentThreadID () |
DLL_BASE_EXIM void | YieldToAnotherThread () |
DLL_BASE_EXIM void | Sleep (unsigned long inMilliseconds) |
DLL_BASE_EXIM ReturnWString | IPAddress2MachineName (const MBase::String &ipAddr) throw () |
DLL_BASE_EXIM ReturnWString | MachineName2IPAddress (const MBase::String &ipMachineName) throw () |
DLL_BASE_EXIM unsigned short | GetNumberOfSystemProcessors () throw () |
DLL_BASE_EXIM MBase::ReturnWString | GetModuleFileNameByAddressWithinModule (const void *ipAddressWithinModule) |
MBase::ReturnWString | GetThisModuleFileName () |
DLL_BASE_EXIM MBase::ReturnWString | GetCurrentLogin () |
DLL_BASE_EXIM unsigned Int32 | GetPseudoRandomInt32 (unsigned Int32 iMaxValue) throw () |
bool | IsBigEndian () |
DLL_BASE_EXIM MBase::ReturnWString | UserIDToName (int iUserID) |
DLL_BASE_EXIM int | UserNameToID (const WCHAR *ipUserName) |
DLL_BASE_EXIM MBase::ReturnWString | GroupIDToName (int iGroupID) |
DLL_BASE_EXIM int | GroupNameToID (const WCHAR *ipGroupName) |
DLL_BASE_EXIM unsigned long int | GetPrivateBytes () |
DLL_BASE_EXIM void | PauseCurrentProcess () |
DLL_BASE_EXIM bool | GetSymPageSize (size_t *opPageSize) |
DLL_BASE_EXIM ReturnWString | GetCurrentProcessName () |
DLL_BASE_EXIM ReturnWString | UTF8ToWideChar (const char *ipUTF8, bool ibUseSubstitutionCharacter=false) |
DLL_BASE_EXIM bool | UTF8IsLeadingByte (char iUTF8) |
DLL_BASE_EXIM unsigned Int32 | UTF8TotalBytes (char iUTF8) |
DLL_BASE_EXIM ReturnString | WideCharToUTF8 (const WCHAR *ipWide, bool ibUseSubstitutionCharacter=false) |
DLL_BASE_EXIM ReturnString | WideCharToUTF8UsingLength (const WCHAR *ipWide, unsigned Int32 iLength, bool ibUseSubstitutionCharacter=false) |
DLL_BASE_EXIM ReturnString | WideCharToUTF8Governed (const WCHAR *ipWide, bool ibUseSubstitutionCharacter, MBase::MemoryContractPtr &irMemContract) |
DLL_BASE_EXIM ReturnString | WideCharToUTF8UsingLengthGoverned (const WCHAR *ipWide, unsigned Int32 iLength, MBase::MemoryContractPtr &irMemContract, bool ibUseSubstitutionCharacter=false) |
DLL_BASE_EXIM ReturnWString | UTF16ToWideChar (const unsigned short *ipUTF16, bool ibUseSubstitutionCharacter=false) |
DLL_BASE_EXIM ReturnUString | WideCharToUTF16 (const WCHAR *ipWide, bool ibUseSubstitutionCharacter=false) |
template<class T > | |
T | ConvertEndian (T iData) |
template<class Function > | |
ScopeGuardImpl0< Function > | MakeMethodGuard (Function iFunction) throw () |
template<class Function , class Parameter1 > | |
ScopeGuardImpl1< Function, Parameter1 > | MakeMethodGuard (Function iFunction, const Parameter1 &iParameter1) throw () |
template<class Function , class Parameter1 , class Parameter2 > | |
ScopeGuardImpl2< Function, Parameter1, Parameter2 > | MakeMethodGuard (Function iFunction, const Parameter1 &iParameter1, const Parameter2 &iParameter2) throw () |
template<class Function , class Parameter1 , class Parameter2 , class Parameter3 > | |
ScopeGuardImpl3< Function, Parameter1, Parameter2, Parameter3 > | MakeMethodGuard (Function iFunction, const Parameter1 &iParameter1, const Parameter2 &iParameter2, const Parameter3 &iParameter3) throw () |
template<class Function , class Parameter1 , class Parameter2 , class Parameter3 , class Parameter4 > | |
ScopeGuardImpl4< Function, Parameter1, Parameter2, Parameter3, Parameter4 > | MakeMethodGuard (Function iFunction, const Parameter1 &iParameter1, const Parameter2 &iParameter2, const Parameter3 &iParameter3, const Parameter4 &iParameter4) throw () |
template<class Object , class MemberFunction > | |
ObjectScopeGuardImpl0< Object, MemberFunction > | MakeObjectGuard (Object &iObject, MemberFunction iMemberFunction) throw () |
template<class Object , class MemberFunction , class Parameter1 > | |
ObjectScopeGuardImpl1< Object, MemberFunction, Parameter1 > | MakeObjectGuard (Object &iObject, MemberFunction iMemberFunction, Parameter1 iParameter1) throw () |
template<class Object , class MemberFunction , class Parameter1 , class Parameter2 > | |
ObjectScopeGuardImpl2< Object, MemberFunction, Parameter1, Parameter2 > | MakeObjectGuard (Object &iObject, MemberFunction iMemberFunction, Parameter1 iParameter1, Parameter2 iParameter2) throw () |
Variables | |
DLL_BASE_EXIM const MessageDomain | MESSAGE_DOMAIN_UNKNOWN |
DLL_BASE_EXIM const MessageDomain | MESSAGE_DOMAIN_ERRNO |
DLL_BASE_EXIM const MessageDomain | MESSAGE_DOMAIN_UNIX_DLERROR |
DLL_BASE_EXIM const MessageDomain | MESSAGE_DOMAIN_UNIX_SIGNAL |
DLL_BASE_EXIM const MessageDomain | MESSAGE_DOMAIN_SERVER |
const bool | kTRUE = 1 |
const bool | kFALSE = 0 |
DLL_BASE_EXIM const WCHAR | UNICODE_BYTE_ORDER_MARK [] |
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
Use the MultiByte functions with extreme caution. If you are not absolutely sure - use ASCII or UTF8 instead, whichever is more appropriate.
The problems with MultiByte conversion are:
1) the multi-byte encoding is determined by locale – set externally to the program.
2) many multi-byte encodings are limited to a small subset of the whole range of Unicode values. So Unicode->MultiByte conversion may be lossy.
Therefore, no internal code shall use MultiByte conversions. If you do, everything may work perfectly within your environment, but will fall apart with an unusual combination of locale and international characters in a converted string.
Only console I/O functions that must localized may use MultiByte conversions.
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
Scope guards are used to automatically rollback opertions.
Declare a local scope guard with your undo operation. If everything goes ok, then Dismiss() the ScopeGuard and it will have no effect. If an error occurs, or an exception is thrown, the scope guard will execute the undo operation as it goes out of scope. A rollback operation must never throw.
ScopeGuard usage:
Create a ScopeGuard with code like:
ScopeGuard lGuard = MakeObjectGuard(<object>,&<member_function>); // no parameters ScopeGuard lGuard = MakeObjectGuard(<object>,&<member_function>,<param1>); // one parameter ScopeGuard lGuard = MakeObjectGuard(<object>,&<member_function>,<param1>,<param2>); // two parameters
ScopeGuard lGuard = MakeMethodGuard(&<function>); // no parameters ScopeGuard lGuard = MakeMethodGuard(&<function>,<param1>); // one parameter ScopeGuard lGuard = MakeMethodGuard(&<function>,<param1>,<param2>); // two parameters
Note: The pass-in parameter in MakeObjectGuard was defined as pass-in-by-value for historical reason. (The one in MakeMethodGuard was defined as pass-in-by-reference, which is fine) So please use reference or pointer for the pass-in parameter in MakeObjectGuard Refer to the VectorGuard3 in ScopeGuardTest.cpp for detail
typedef Message MBase::BaseException |
typedef StrongPtr<Buffer,DeleteOperatorGeneric<Buffer> > MBase::BufferPtr |
typedef std::string MBase::CString |
MBase::String is just a typedef of std::wstring using MBase::Allocator, so that it can be used with MBase::Buffer.
typedef unsigned Int32 MBase::ErrorCode |
typedef unsigned short MBase::LanguageID |
A language ID is a 16 bit value which is the combination of a primary language ID and a secondary language ID. The bits are allocated as follows:
+-----------------------+-------------------------+ | Sublanguage ID | Primary Language ID | +-----------------------+-------------------------+ 15 10 9 0 bit
typedef long long MBase::Long64_t |
typedef unsigned short MBase::MessageDomain |
Message domain describes which API a message belongs to.
IMPORTANT:
Given a message ID (such as 123), and a message domain, it must be absolutely non-ambiguous what this message is and what it means. This is why for example MESSAGE_DOMAIN_ERRNO has a different value on different platforms. See MessageDomain.cpp.
Note: for each new domain, you should add a new Bundle in the Resource project.
typedef Int32 MBase::MessageID |
typedef const ScopeGuardImplBase& MBase::ScopeGuard |
typedef std::basic_string< WCHAR, std::char_traits< WCHAR >, Allocator< WCHAR > > MBase::String |
MBase::String is just a typedef of std::wstring using MBase::Allocator, so that it can be used with MBase::Buffer.
typedef unsigned long long MBase::ULong64_t |
typedef void(* MBase::VoidFuncPtr_t) () |
DLL_BASE_EXIM ReturnWString MBase::ASCIIToWideChar | ( | const char * | ipASCII, |
bool | ibUseSubstitutionCharacter = false |
||
) |
Converts an ASCII string to "wide characters" (wchar_t). Only ASCII values in the range 0..127 are allowed.
ipASCII | An ASCII string. |
ibUseSubstitutionCharacter | when true, replaces invalid characters with '?' otherwise throws an exception when an illegal character is found. |
StringConversionException | when an invalid character found and ibUseSubstitutionCharacter == false |
|
inline |
Atomically assigns iNewValue and returns a previous value.
DLL_BASE_EXIM ReturnWString MBase::Binary2OctString | ( | void * | ipBin, |
Int32 | iSize | ||
) |
Converts a binary sequence into its zero padded octaldecimal string form.
ipBin A pointer pointing to the head of the binary sequence. | |
iSize The length of the binary sequence(in bytes). |
For example: 0010 0001 0000 0011 1111 1110 (iSize = 3) will be converted to L"\\041\\003\\376"
DLL_BASE_EXIM ReturnWString MBase::Binary2String | ( | void * | ipBin, |
Int32 | iSize | ||
) |
Converts a binary sequence into its zero padded hexadecimal string form.
ipBin A pointer pointing to the head of the binary sequence. | |
iSize The length of the binary sequence(in bytes). |
For example: 0010 0001 0000 0011 1111 1110 (iSize = 3) will be converted to L"2103FE"
CompareGUID returns: <0 when irGUID1 < irGUID2 0 when irGUID1 == irGUID2 >0 when irGUID1 > irGUID2
|
inline |
Template function to conduct endian conversion on the given data type. Since Intel and SUN/IBM have different endian architecture, when a block of memory needs to be interpreted as some data type, the result will be different. Use this function to perform the conversion. This is an inline function to reduce the cost of a function call, especially for the case where an array of data needs to be converted. To use it, please specify the data type to be converted. For example, to convert long, call it like this: MBase::ConvertEndian<long>(lnData).
DLL_BASE_EXIM Buffer* MBase::CreateBuffer | ( | Int32 | iSize, |
Int32 | iExtSize, | ||
Int32 | iBlkSize = Buffer::NT_BLOCK_SIZE , |
||
bool | ibOnPageBoundary = false |
||
) |
throws ContractManagerException (defined in BaseMemoryContract.h)
DLL_BASE_EXIM Buffer* MBase::CreateBuffer | ( | Int32 | iSize, |
Int32 | iExtSize, | ||
MBase::MemoryContract * | ipMemoryContract, | ||
Int32 | iBlkSize = Buffer::NT_BLOCK_SIZE , |
||
bool | ibOnPageBoundary = false |
||
) |
throws ContractManagerException (defined in BaseMemoryContract.h)
DLL_BASE_EXIM FragmentedString* MBase::CreateFragmentedString | ( | WCHAR * | ipStr, |
size_t | iSize, | ||
const MBase::Allocator< WCHAR > & | iAlloc = MBase::Allocator< WCHAR >() |
||
) |
DLL_BASE_EXIM FragmentedString* MBase::CreateFragmentedString | ( | WCHAR * | ipStr, |
const MBase::Allocator< WCHAR > & | iAlloc = MBase::Allocator< WCHAR >() |
||
) |
void MBase::CreateGUID | ( | ::GUID & | orGUID | ) |
Generates a new globally unique value.
MBase::BaseException | in case of an error. |
DLL_BASE_EXIM int MBase::DecimalToInt | ( | const WCHAR * | ipStr | ) |
Converts a decimal number into a 32-bit integer
DLL_BASE_EXIM int MBase::DecimalToInt | ( | const char * | ipStr | ) |
Converts a decimal number into a 32-bit integer
DLL_BASE_EXIM Int64 MBase::DecimalToInt64 | ( | const wchar_t * | ipStr | ) |
Converts a decimal number into a 64-bit integer
DLL_BASE_EXIM Int64 MBase::DecimalToInt64 | ( | const char * | ipStr | ) |
Converts a decimal number into a 64-bit integer
DLL_BASE_EXIM ReturnWString MBase::GetComputerName | ( | ) |
DLL_BASE_EXIM MBase::ReturnWString MBase::GetCurrentLogin | ( | ) |
Return a string representation of the current login: on Windows: domain on UNIX: username
DLL_BASE_EXIM unsigned Int32 MBase::GetCurrentProcessID | ( | ) |
DLL_BASE_EXIM ReturnWString MBase::GetCurrentProcessName | ( | ) |
DLL_BASE_EXIM unsigned Int32 MBase::GetCurrentThreadID | ( | ) |
IMPORTANT: the returned value is NOT guaranteed to be the underlying OS thread id.
DLL_BASE_EXIM MBase::ReturnWString MBase::GetEnvironmentVariableOrNULL | ( | const WCHAR * | ipVariableName | ) |
DEPRECATED!!! Do not use this method
DLL_BASE_EXIM ErrorCode MBase::GetLastError | ( | ) | ||
throw | ( | |||
) |
Insead use: errno – on Windows, UNIX, or GetLastError() – on Windows
DLL_BASE_EXIM MBase::ReturnWString MBase::GetModuleFileNameByAddressWithinModule | ( | const void * | ipAddressWithinModule | ) |
DLL_BASE_EXIM unsigned short MBase::GetNumberOfSystemProcessors | ( | ) | ||
throw | ( | |||
) |
|
inline |
DLL_BASE_EXIM unsigned long int MBase::GetPrivateBytes | ( | ) |
DLL_BASE_EXIM const char* MBase::GetProcessLocale | ( | ) | ||
throw | ( | |||
) |
DLL_BASE_EXIM unsigned Int32 MBase::GetPseudoRandomInt32 | ( | unsigned Int32 | iMaxValue | ) | |
throw | ( | ||||
) |
This method returns a pseudo-random sequence of integers in the range of 1 to iMaxValue.
DLL_BASE_EXIM ReturnWString MBase::GetSignalDescriptionOrNULL | ( | int | iSignalNumber | ) | |
throw | ( | ||||
) |
Return a string describing a signal in the current locale, or NULL if the description is not available.
DLL_BASE_EXIM ReturnString MBase::GetSignalNameOrDecimalString | ( | int | iSignalNumber | ) | |
throw | ( | ||||
) |
Return a string with the signal name, such as HUP, INT, ILL, KILL, SEGV, and so on or a string formatted as decimal integer.
DLL_BASE_EXIM ReturnString MBase::GetSignalNameOrNULL | ( | int | iSignalNumber | ) | |
throw | ( | ||||
) |
Return a string with the signal name, such as HUP, INT, ILL, KILL, SEGV, and so on or NULL of the signal number is invalid.
DLL_BASE_EXIM ReturnWString MBase::GetStandardCLibraryErrorDescriptionOrNULL | ( | int | iErrorCode | ) | |
throw | ( | ||||
) |
Return a string describing a Standard C Library error, as returned by errno
DLL_BASE_EXIM ReturnString MBase::GetStandardCLibraryErrorSymbolOrDecimalString | ( | int | iErrorCode | ) | |
throw | ( | ||||
) |
Return a a Standard C Library error symbol (such as EPERM) or a string formatted as decimal integer.
DLL_BASE_EXIM ReturnString MBase::GetStandardCLibraryErrorSymbolOrNULL | ( | int | iErrorCode | ) | |
throw | ( | ||||
) |
Return a a Standard C Library error symbol (such as EPERM) or NULL.
DLL_BASE_EXIM bool MBase::GetSymPageSize | ( | size_t * | opPageSize | ) |
DLL_BASE_EXIM ReturnWString MBase::GetSystemErrorDescription | ( | ErrorCode | iErrorCode | ) | |
throw | ( | ||||
) |
Instead use: MBase::GetStandardCLibraryErrorDescriptionOrNULL – for error codes returned by errno, or MBase::GetWin32APIErrorDescriptionOrNULL – for error codes returned by GetLastError()
|
inline |
DLL_BASE_EXIM Int32 MBase::GetUniqueMachineID | ( | ) |
pID | upon return a unique machine ID based on machine address. |
DLL_BASE_EXIM MBase::ReturnWString MBase::GroupIDToName | ( | int | iGroupID | ) |
Lookup a group name given a group ID.
DLL_BASE_EXIM int MBase::GroupNameToID | ( | const WCHAR * | ipGroupName | ) |
Lookup a group ID given a group name.
DLL_BASE_EXIM ReturnWString MBase::Guid2MSString | ( | const ::GUID & | irGuid | ) |
Guid2MSString converts a guid structure into its Microsoft's string form. The string format is identical to the one used in Microsoft's registry.
Format example: guid { 0x01234567, 0x89ab, 0xcdef, { 0x02, 0x46, 0x8a, 0xce, 0x13, 0x57, 0x9b, 0xdf } } will be converted to string "{01234567-89AB-CDEF-0246-8ACE13579BDF}"
DLL_BASE_EXIM ReturnWString MBase::Guid2String | ( | const ::GUID & | irGUID | ) |
Guid2String converts a guid structure into its string form. The string format is proprietary to MicroStrategy.
Format example: guid { 0x01234567, 0x89ab, 0xcdef, { 0x02, 0x46, 0x8a, 0xce, 0x13, 0x57, 0x9b, 0xdf } } will be converted to string "01234567CDEF89ABCE8A4602DF9B5713"
DLL_BASE_EXIM unsigned int MBase::HexToUnsignedInt | ( | const WCHAR * | ipStr, |
bool | iIgnoreTrailingCharacters = false |
||
) |
Convert a string into a 32-bit unsigned integer.
ipStr | a hex number in the range [0 .. 0xFFFFFFFE] without any prefix. |
iIgnoreTrailingCharacters | whether to ignore the unparsed tail of the input string. |
MBase::StringConversionException | in case of an error. |
DLL_BASE_EXIM unsigned int MBase::HexToUnsignedInt | ( | const char * | ipStr, |
bool | iIgnoreTrailingCharacters = false |
||
) |
DLL_BASE_EXIM ReturnWString MBase::IPAddress2MachineName | ( | const MBase::String & | ipAddr | ) | |
throw | ( | ||||
) |
|
inline |
Returns true if the machine is big endian, false otherwise
|
inline |
DLL_BASE_EXIM bool MBase::IsSystemError | ( | ErrorCode | iErrorCode | ) | |
throw | ( | ||||
) |
Do not use this one at all!
DLL_BASE_EXIM double MBase::LocaleNeutralStringToDouble | ( | const WCHAR * | ipValueString | ) |
Converts a string in the following format to double 123.456, +1234.456, -1234.456, -.456, or -456. 123.456, +1234.456, -1.2344e56, -.45E-6
DLL_BASE_EXIM ReturnWString MBase::MachineName2IPAddress | ( | const MBase::String & | ipMachineName | ) | |
throw | ( | ||||
) |
|
inline |
ScopeGuardImpl0<Function> MBase::MakeMethodGuard | ( | Function | iFunction | ) | |
throw | ( | ||||
) |
Function to create a ScopeGuardImpl0.
ScopeGuardImpl1<Function, Parameter1> MBase::MakeMethodGuard | ( | Function | iFunction, |
const Parameter1 & | iParameter1 | ||
) | |||
throw | ( | ||
) |
Function to create a ScopeGuardImpl1.
ScopeGuardImpl2<Function, Parameter1, Parameter2> MBase::MakeMethodGuard | ( | Function | iFunction, |
const Parameter1 & | iParameter1, | ||
const Parameter2 & | iParameter2 | ||
) | |||
throw | ( | ||
) |
Function to create a ScopeGuardImpl2.
ScopeGuardImpl3<Function, Parameter1, Parameter2, Parameter3> MBase::MakeMethodGuard | ( | Function | iFunction, |
const Parameter1 & | iParameter1, | ||
const Parameter2 & | iParameter2, | ||
const Parameter3 & | iParameter3 | ||
) | |||
throw | ( | ||
) |
Function to create a ScopeGuardImpl3.
ScopeGuardImpl4<Function, Parameter1, Parameter2, Parameter3, Parameter4> MBase::MakeMethodGuard | ( | Function | iFunction, |
const Parameter1 & | iParameter1, | ||
const Parameter2 & | iParameter2, | ||
const Parameter3 & | iParameter3, | ||
const Parameter4 & | iParameter4 | ||
) | |||
throw | ( | ||
) |
Function to create a ScopeGuardImpl3.
ObjectScopeGuardImpl0<Object, MemberFunction> MBase::MakeObjectGuard | ( | Object & | iObject, |
MemberFunction | iMemberFunction | ||
) | |||
throw | ( | ||
) |
Function to create a ObjectScopeGuardImpl0.
ObjectScopeGuardImpl1<Object, MemberFunction, Parameter1> MBase::MakeObjectGuard | ( | Object & | iObject, |
MemberFunction | iMemberFunction, | ||
Parameter1 | iParameter1 | ||
) | |||
throw | ( | ||
) |
Function to create a ObjectScopeGuardImpl1.
ObjectScopeGuardImpl2<Object, MemberFunction, Parameter1, Parameter2> MBase::MakeObjectGuard | ( | Object & | iObject, |
MemberFunction | iMemberFunction, | ||
Parameter1 | iParameter1, | ||
Parameter2 | iParameter2 | ||
) | |||
throw | ( | ||
) |
Function to create a ObjectScopeGuardImpl2.
DLL_BASE_EXIM bool MBase::MSString2Guid | ( | ::GUID & | orGuid, |
const WCHAR * | ipString | ||
) |
MSString2Guid converts from Microsoft's string version to the guid structure version of a GUID. The string format is identical to the one used in Microsoft's registry.
Format example: string "{01234567-89AB-CDEF-0246-8ACE13579BDF}" will be converted to guid { 0x01234567, 0x89ab, 0xcdef, { 0x02, 0x46, 0x8a, 0xce, 0x13, 0x57, 0x9b, 0xdf } }
DLL_BASE_EXIM ReturnWString MBase::MultiByteToWideChar | ( | const char * | ipMultiByte, |
bool | ibUseSubstitutionCharacter = false |
||
) |
Converts a multi-byte string (assumed to be encoded accordingly to the current locale settings) to "wide characters" (wchar_t).
ipMultiByte | A multi-byte string. |
ibUseSubstitutionCharacter | when true, replaces invalid characters with '?' otherwise throws an exception when an illegal character is found. |
StringConversionException | when an invalid character found and ibUseSubstitutionCharacter is false. |
|
inline |
String2Guid converts from the string version to the guid structure version of a GUID. The string format is proprietary to MicroStrategy.
Format example: string "01234567CDEF89ABCE8A4602DF9B5713" will be converted to guid { 0x01234567, 0x89ab, 0xcdef, { 0x02, 0x46, 0x8a, 0xce, 0x13, 0x57, 0x9b, 0xdf } }
|
inline |
DLL_BASE_EXIM void MBase::OutputDebugString | ( | const WCHAR * | ipDebugString | ) | |
throw | ( | ||||
) |
This function outputs a string into the "debug" stream on Windows and stderr on UNIX.
The debug string will be terminated with
on Windows and
on UNIX.
DLL_BASE_EXIM void MBase::OutputDebugString | ( | const char * | ipDebugString | ) | |
throw | ( | ||||
) |
DLL_BASE_EXIM void MBase::PauseCurrentProcess | ( | ) |
DLL_BASE_EXIM MBase::ReturnWString MBase::ReadEnvironmentVariable | ( | const WCHAR * | ipVariableName | ) |
DLL_BASE_EXIM void MBase::Sleep | ( | unsigned long | inMilliseconds | ) |
Efficiently wait for at least the number of milliseconds.
String2Guid converts from the string version to the guid structure version of a GUID. The string format is proprietary to MicroStrategy.
Format example: string "01234567CDEF89ABCE8A4602DF9B5713" will be converted to guid { 0x01234567, 0x89ab, 0xcdef, { 0x02, 0x46, 0x8a, 0xce, 0x13, 0x57, 0x9b, 0xdf } }
|
inline |
|
inline |
DLL_BASE_EXIM ReturnString MBase::ToDecimalString | ( | int | iValue | ) |
Converts an int into a decimal string
DLL_BASE_EXIM ReturnWString MBase::ToDecimalWString | ( | int | iValue | ) |
Converts an int into a decimal string
DLL_BASE_EXIM ReturnString MBase::ToHexLowerString | ( | int | iValue | ) |
Converts an int into a lower-case hex string
DLL_BASE_EXIM ReturnWString MBase::ToHexLowerWString | ( | int | iValue | ) |
Converts an int into a lower-case hex string
DLL_BASE_EXIM ReturnString MBase::ToHexUpperString | ( | int | iValue | ) |
Converts an int into an upper-case hex string
DLL_BASE_EXIM ReturnWString MBase::ToHexUpperWString | ( | int | iValue | ) |
Converts an int into an upper-case hex string
DLL_BASE_EXIM MBase::MessageDomain MBase::ToMessageDomain | ( | const char * | ipDomain | ) |
Convert a string to a MessageDomain.
DLL_BASE_EXIM const char* MBase::ToString | ( | MBase::MessageDomain | iDomain | ) |
Convert a MessageDomain to a string.
DLL_BASE_EXIM MBase::ReturnWString MBase::UserIDToName | ( | int | iUserID | ) |
Lookup a user name given a user ID.
DLL_BASE_EXIM int MBase::UserNameToID | ( | const WCHAR * | ipUserName | ) |
Lookup a user ID given a user name.
DLL_BASE_EXIM ReturnWString MBase::UTF16ToWideChar | ( | const unsigned short * | ipUTF16, |
bool | ibUseSubstitutionCharacter = false |
||
) |
Converts a Unicode string from UTF-16 to platform-specific "wide characters" (wchar_t), which carry UCS-2 Unicode values.
ipUTF16 | A Unicode string encoded using UTF-16. |
ibUseSubstitutionCharacter | when true, replaces invalid characters with U+FFFD otherwise throws an exception when an illegal character is found. |
StringConversionException | when an invalid character found and ibUseSubstitutionCharacter == false |
DLL_BASE_EXIM bool MBase::UTF8IsLeadingByte | ( | char | iUTF8 | ) |
Checks a single byte in a UTF-8 string and returns true if it is the leading byte (the first byte in a series of bytes that makes up one character)
iUTF8 | A single byte in a UTF-8 string |
DLL_BASE_EXIM unsigned Int32 MBase::UTF8TotalBytes | ( | char | iUTF8 | ) |
Checks the lead byte in a UTF-8 string and returns the number of bytes in this one character
iUTF8 | A single byte in a UTF-8 string |
StringConversionException | when input character is not the leading byte or is an invalid octet |
DLL_BASE_EXIM ReturnWString MBase::UTF8ToWideChar | ( | const char * | ipUTF8, |
bool | ibUseSubstitutionCharacter = false |
||
) |
Converts a Unicode string from UTF-8 to platform-specific "wide characters" (wchar_t), which carry UCS-2 Unicode values.
ipUTF8 | A Unicode string encoded using UTF-8. |
ibUseSubstitutionCharacter | when true, replaces invalid characters with U+FFFD otherwise throws an exception when an illegal character is found. |
StringConversionException | when an invalid character found and ibUseSubstitutionCharacter == false |
|
inline |
ReturnWString DLL_BASE_EXIM MBase::WideChar2String | ( | WCHAR | iWideChar | ) |
Converts a wide character into its zero padded hexadecimal string form.
Format example: L'A' will be converted to L"0041"
DLL_BASE_EXIM ReturnString MBase::WideCharToASCII | ( | const wchar_t * | ipWide, |
bool | ibUseSubstitutionCharacter = false |
||
) |
Converts a wide character string to an ASCII string. Only ASCII values in the range 0..127 are allowed.
ipWide | A wide character string. |
ibUseSubstitutionCharacter | when true, replaces invalid characters with '?' otherwise throws an exception |
StringConversionException | when an invalid character found and ibUseSubstitutionCharacter is false. |
DLL_BASE_EXIM ReturnString MBase::WideCharToMultiByte | ( | const WCHAR * | ipWide, |
bool | ibUseSubstitutionCharacter = false |
||
) |
Converts a wide character string to a multi-byte string in a locale-dependent encoding.
ipWide | A wide character string. |
ibUseSubstitutionCharacter | when true, replaces invalid characters with '?' otherwise throws an exception. |
StringConversionException | when an character cannot be converted is found and ibUseSubstitutionCharacter is false. |
DLL_BASE_EXIM ReturnUString MBase::WideCharToUTF16 | ( | const WCHAR * | ipWide, |
bool | ibUseSubstitutionCharacter = false |
||
) |
Converts a Unicode string from platform-specific "wide characters" (wchar_t) to UTF-16.
ipWide | A wide character Unicode string. |
ibUseSubstitutionCharacter | when true, replaces invalid characters with U+FFFD otherwise throws an exception |
StringConversionException | when an invalid character found and ibUseSubstitutionCharacter == false |
DLL_BASE_EXIM ReturnString MBase::WideCharToUTF8 | ( | const WCHAR * | ipWide, |
bool | ibUseSubstitutionCharacter = false |
||
) |
Converts a Unicode string from platform-specific "wide characters" (wchar_t) to UTF-8.
ipWide | A wide character Unicode string. |
ibUseSubstitutionCharacter | when true, replaces invalid characters with U+FFFD otherwise throws an exception |
StringConversionException | when an invalid character found and ibUseSubstitutionCharacter == false |
DLL_BASE_EXIM ReturnString MBase::WideCharToUTF8Governed | ( | const WCHAR * | ipWide, |
bool | ibUseSubstitutionCharacter, | ||
MBase::MemoryContractPtr & | irMemContract | ||
) |
Converts a Unicode string from platform-specific "wide characters" (wchar_t) to UTF-8.
ipWide | A wide character Unicode string. |
ibUseSubstitutionCharacter | when true, replaces invalid characters with U+FFFD otherwise throws an exception |
irMemContract | a memory contract used to govern the memory allocation |
StringConversionException | when an invalid character found and ibUseSubstitutionCharacter == false |
DLL_BASE_EXIM ReturnString MBase::WideCharToUTF8UsingLength | ( | const WCHAR * | ipWide, |
unsigned Int32 | iLength, | ||
bool | ibUseSubstitutionCharacter = false |
||
) |
Converts a Unicode string from platform-specific "wide characters" (wchar_t) to UTF-8. This differs from the above method in that the passed in string need not be null terminated. The passed out string will be null terminated
ipWide | A wide character Unicode string. |
iLength | The number of characters to convert |
ibUseSubstitutionCharacter | when true, replaces invalid characters with U+FFFD otherwise throws an exception |
StringConversionException | when an invalid character found and ibUseSubstitutionCharacter == false |
DLL_BASE_EXIM ReturnString MBase::WideCharToUTF8UsingLengthGoverned | ( | const WCHAR * | ipWide, |
unsigned Int32 | iLength, | ||
MBase::MemoryContractPtr & | irMemContract, | ||
bool | ibUseSubstitutionCharacter = false |
||
) |
DLL_BASE_EXIM void MBase::YieldToAnotherThread | ( | ) |
Yield execution to another thread.
This method has the same semantics as ::SwitchToThread on Win32, and ::sched_yield on UNIX.
NOTE: Do not use MBase::Sleep(0) instead of MSynch::YieldToAnotherThread.
const bool MBase::kFALSE = 0 |
const bool MBase::kTRUE = 1 |
DLL_BASE_EXIM const MessageDomain MBase::MESSAGE_DOMAIN_ERRNO |
DLL_BASE_EXIM const MessageDomain MBase::MESSAGE_DOMAIN_SERVER |
DLL_BASE_EXIM const MessageDomain MBase::MESSAGE_DOMAIN_UNIX_DLERROR |
DLL_BASE_EXIM const MessageDomain MBase::MESSAGE_DOMAIN_UNIX_SIGNAL |
DLL_BASE_EXIM const MessageDomain MBase::MESSAGE_DOMAIN_UNKNOWN |
DLL_BASE_EXIM const WCHAR MBase::UNICODE_BYTE_ORDER_MARK[] |
A Unicode BOM (Byte Order Mark)