fbxsdk/fileio/collada/fbxcolladaiostream.h File Reference
|
template<typename T > |
bool | FromString (T *pDest, const char *pSourceBegin, const char **pSourceEnd=((void *) 0)) |
| Convert part of the source string into destination type. More...
|
|
template<> |
bool | FromString (int *pDest, const char *pSourceBegin, const char **pSourceEnd) |
|
template<> |
bool | FromString (double *pDest, const char *pSourceBegin, const char **pSourceEnd) |
|
template<> |
bool | FromString (FbxString *pDest, const char *pSourceBegin, const char **pSourceEnd) |
|
template<> |
bool | FromString (FbxDouble2 *pDest, const char *pSourceBegin, const char **pSourceEnd) |
|
template<> |
bool | FromString (FbxDouble3 *pDest, const char *pSourceBegin, const char **pSourceEnd) |
|
template<> |
bool | FromString (FbxDouble4 *pDest, const char *pSourceBegin, const char **pSourceEnd) |
|
template<> |
bool | FromString (FbxVector4 *pDest, const char *pSourceBegin, const char **pSourceEnd) |
|
template<> |
bool | FromString (FbxAMatrix *pDest, const char *pSourceBegin, const char **pSourceEnd) |
|
template<typename TYPE > |
int | FromStringToArray (const char *pString, TYPE *pArray, int pSourceUnitOffset, int pSourceValidUnitCount, int pSourceGroupSize, int pDestUnitOffset, int pDestValidUnitCount, int pDestGroupSize, TYPE pDefaultValue=TYPE()) |
| Parse the string into an array. More...
|
|
template<typename T > |
const FbxString | ToString (const T &pValue) |
|
template<> |
const FbxString | ToString (const FbxVector4 &pValue) |
|
template<> |
const FbxString | ToString (const FbxAMatrix &pValue) |
|
const FbxString | DecodePercentEncoding (const FbxString &pEncodedString) |
| Decode percent encoded characters, returns an empty string if there's an error. More...
|
|
bool FromString |
( |
T * |
pDest, |
|
|
const char * |
pSourceBegin, |
|
|
const char ** |
pSourceEnd = ((void *) 0) |
|
) |
| |
Convert part of the source string into destination type.
- Parameters
-
pDest | The destination with a specific type. |
pSourceBegin | The begin of the source string. |
pSourceEnd | Return the end of the part of the source string. |
- Returns
- Return
true
on success and false
if else.
bool FromString |
( |
int * |
pDest, |
|
|
const char * |
pSourceBegin, |
|
|
const char ** |
pSourceEnd |
|
) |
| |
bool FromString |
( |
double * |
pDest, |
|
|
const char * |
pSourceBegin, |
|
|
const char ** |
pSourceEnd |
|
) |
| |
bool FromString |
( |
FbxString * |
pDest, |
|
|
const char * |
pSourceBegin, |
|
|
const char ** |
pSourceEnd |
|
) |
| |
bool FromString |
( |
FbxDouble2 * |
pDest, |
|
|
const char * |
pSourceBegin, |
|
|
const char ** |
pSourceEnd |
|
) |
| |
bool FromString |
( |
FbxDouble3 * |
pDest, |
|
|
const char * |
pSourceBegin, |
|
|
const char ** |
pSourceEnd |
|
) |
| |
bool FromString |
( |
FbxDouble4 * |
pDest, |
|
|
const char * |
pSourceBegin, |
|
|
const char ** |
pSourceEnd |
|
) |
| |
bool FromString |
( |
FbxVector4 * |
pDest, |
|
|
const char * |
pSourceBegin, |
|
|
const char ** |
pSourceEnd |
|
) |
| |
bool FromString |
( |
FbxAMatrix * |
pDest, |
|
|
const char * |
pSourceBegin, |
|
|
const char ** |
pSourceEnd |
|
) |
| |
int FromStringToArray |
( |
const char * |
pString, |
|
|
TYPE * |
pArray, |
|
|
int |
pSourceUnitOffset, |
|
|
int |
pSourceValidUnitCount, |
|
|
int |
pSourceGroupSize, |
|
|
int |
pDestUnitOffset, |
|
|
int |
pDestValidUnitCount, |
|
|
int |
pDestGroupSize, |
|
|
TYPE |
pDefaultValue = TYPE() |
|
) |
| |
Parse the string into an array.
The source string is made up with many groups and each group contains pSourceGroupSize units separated by spaces; The destination array is also made up with many groups and each unit contains pDestGroupSize units. The valid unit range in each source group is [pSourceUnitOffset, pSourceUnitOffset + pSourceValidUnitCount). The valid unit range in each destination unit is [pDestUnitOffset, pDestUnitOffset + pDestValidUnitCount). The units in invalid range of destination is set to a default value.
Definition at line 48 of file fbxcolladaiostream.h.
50 if (pString == 0 || pArray == 0)
53 FBX_ASSERT(pSourceUnitOffset >= 0 && pSourceUnitOffset < pSourceGroupSize);
54 FBX_ASSERT(pSourceValidUnitCount >= 0 && pSourceUnitOffset + pSourceValidUnitCount <= pSourceGroupSize);
55 FBX_ASSERT(pDestUnitOffset >= 0 && pDestUnitOffset < pDestGroupSize);
56 FBX_ASSERT(pDestValidUnitCount >= 0 && pDestUnitOffset + pDestValidUnitCount <= pDestGroupSize);
57 const char * lSource = pString;
58 TYPE * lDest = pArray;
61 int lSourceCounter = 0;
63 const int lSourceUnitValidEnd = pSourceUnitOffset + pSourceValidUnitCount;
64 const int lDestUnitGap = pDestGroupSize - pDestValidUnitCount - pDestUnitOffset;
65 while (lSource && *lSource)
68 const char * lSourceStart = lSource;
69 if (
FromString(&lData, lSource, &lSource) && lSourceCounter >= pSourceUnitOffset && lSourceCounter < lSourceUnitValidEnd)
71 if (lDestCounter == 0)
73 for (
int lIndex = 0; lIndex < pDestUnitOffset; ++lIndex)
74 *(lDest++) = pDefaultValue;
80 if (lDestCounter == pDestValidUnitCount)
83 for (
int lIndex = 0; lIndex < lDestUnitGap; ++lIndex)
84 *lDest++ = pDefaultValue;
92 if (lSource == lSourceStart)
98 if (lSourceCounter == pSourceGroupSize)
bool FromString(T *pDest, const char *pSourceBegin, const char **pSourceEnd=((void *) 0))
Convert part of the source string into destination type.
Decode percent encoded characters, returns an empty string if there's an error.
For example, a string like "abc%20abc" is converted into "abc abc".
- Parameters
-
pEncodedString | The percent encoded string. |
- Returns
- The decoded string.
Go to the source code of this file.