11 #ifndef _LIBALVALUE_ALVALUE_ALVALUE_H_
12 #define _LIBALVALUE_ALVALUE_ALVALUE_H_
27 #ifndef ALVALUE_VERBOSITY
28 # define ALVALUE_VERBOSITY
54 friend void ConvertALValueToSoapXml(
const ALValue *pAlValue,
55 std::string &strToFill,
57 friend class ALNetwork;
183 ALValue(
const std::string &value);
194 ALValue(
const std::vector<std::string> &pListString);
199 ALValue(
const std::vector<float> &pListFloat);
204 ALValue(
const std::vector<int> &pListInt);
211 ALValue(
const void *value,
int nBytes);
217 ALValue(
const char **pArrayOfString,
int nNbrString);
223 ALValue(
const float *pFloat,
int nNbrElement);
229 ALValue(
const int *pInt,
int nNbrElement);
235 ALValue(
const TAlValueBinaryData &rhs);
256 ALValue& operator=(
const bool &rhs);
258 ALValue& operator=(
const int &rhs);
260 ALValue& operator=(
const double &rhs);
262 ALValue& operator=(
const float &rhs);
264 ALValue& operator=(
const char *rhs);
266 ALValue& operator=(
const TAlValueBinaryData &rhs);
273 bool operator==(
ALValue const &other)
const;
279 bool operator!=(
ALValue const &other)
const;
296 operator const bool()
const;
312 operator const int()
const;
328 operator const float()
const;
337 operator const double()
const;
346 operator std::string&();
354 operator const std::string&()
const;
363 operator TAlValueBinaryData&();
371 operator const TAlValueBinaryData&()
const;
379 operator const void*()
const;
428 ALValue& setObject(
const void* pData,
int nDataSizeInBytes);
435 void SetBinary(
const void *rhs,
int nDataSizeInBytes);
442 ALValue& SetBinaryNoCopy(
const void *rhs,
int nDataSizeInBytes);
448 const void* GetBinary()
const;
453 const void* getObject()
const;
471 bool bInsertDefaultOnError =
false)
const;
482 bool bInsertDefaultOnError =
false)
const;
493 bool bInsertDefaultOnError =
false)
const;
510 const ALValue& operator[](
int i)
const;
516 enum Type getType()
const;
522 bool isValid ()
const;
527 bool isArray ()
const;
532 bool isBool ()
const;
542 bool isFloat ()
const;
547 bool isString()
const;
552 bool isObject()
const;
557 bool isBinary()
const;
562 std::vector<unsigned char> asRaw()
const;
569 unsigned int getSize()
const;
581 void arrayReserve(
int size);
588 void arraySetSize(
int size);
599 void arrayPush(
const ALValue &pSrcToCopyNotOwned);
608 void arrayPopFront();
620 std::string toString(Verbosity pnVerbosity = VerbosityMini)
const;
631 std::string toPythonBuffer()
const;
642 bool decodeB64(
const char *pszB64);
653 bool decodeB64Object(
const char *pszB64);
659 void encodeB64(std::string &strOutput)
const;
673 static enum Type deduceType(
const char *szInput,
674 int nLimitToLen = 0x7FFFFFFF);
684 void unSerializeFromText(
const char *szInput,
685 int nLimitToLen = 0x7FFFFFFF);
692 std::string serializeToText(
void)
const;
699 static bool xUnSerializeFromText_InnerTest(
void);
701 template <
typename T0>
702 static ALValue array(
const T0 &a0);
703 template <
typename T0,
typename T1>
704 static ALValue array(
const T0 &a0,
const T1 &a1);
705 template <
typename T0,
typename T1,
typename T2>
706 static ALValue array(
const T0 &a0,
const T1 &a1,
const T2 &a2);
707 template <
typename T0,
typename T1,
typename T2,
typename T3>
708 static ALValue array(
const T0 &a0,
const T1 &a1,
const T2 &a2,
const T3 &a3);
709 template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4>
710 static ALValue array(
const T0 &a0,
const T1 &a1,
const T2 &a2,
const T3 &a3,
const T4 &a4);
711 template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
712 static ALValue array(
const T0 &a0,
const T1 &a1,
const T2 &a2,
const T3 &a3,
const T4 &a4,
const T5 &a5);
713 template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6>
714 static ALValue array(
const T0 &a0,
const T1 &a1,
const T2 &a2,
const T3 &a3,
const T4 &a4,
const T5 &a5,
const T6 &a6);
715 template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7>
716 static ALValue array(
const T0 &a0,
const T1 &a1,
const T2 &a2,
const T3 &a3,
const T4 &a4,
const T5 &a5,
const T6 &a6,
const T7 &a7);
717 template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7,
typename T8>
718 static ALValue array(
const T0 &a0,
const T1 &a1,
const T2 &a2,
const T3 &a3,
const T4 &a4,
const T5 &a5,
const T6 &a6,
const T7 &a7,
const T8 &a8);
719 template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7,
typename T8,
typename T9>
720 static ALValue array(
const T0 &a0,
const T1 &a1,
const T2 &a2,
const T3 &a3,
const T4 &a4,
const T5 &a5,
const T6 &a6,
const T7 &a7,
const T8 &a8,
const T9 &a9);
725 void xAssertCompatibleType(
enum Type pnWantedType);
726 void xAssertType(
enum Type pnWantedType)
const;
727 void xAssertArraySize(
int pnSize)
const;
758 static std::string TypeToString(
enum Type pnType);
762 template <
typename T0>
771 template <
typename T0,
typename T1>
781 template <
typename T0,
typename T1,
typename T2>
792 template <
typename T0,
typename T1,
typename T2,
typename T3>
804 template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4>
817 template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
831 template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6>
832 ALValue ALValue::array(
const T0 &a0,
const T1 &a1,
const T2 &a2,
const T3 &a3,
const T4 &a4,
const T5 &a5,
const T6 &a6)
846 template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7>
847 ALValue ALValue::array(
const T0 &a0,
const T1 &a1,
const T2 &a2,
const T3 &a3,
const T4 &a4,
const T5 &a5,
const T6 &a6,
const T7 &a7)
862 template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7,
typename T8>
863 ALValue ALValue::array(
const T0 &a0,
const T1 &a1,
const T2 &a2,
const T3 &a3,
const T4 &a4,
const T5 &a5,
const T6 &a6,
const T7 &a7,
const T8 &a8)
879 template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7,
typename T8,
typename T9>
880 ALValue ALValue::array(
const T0 &a0,
const T1 &a1,
const T2 &a2,
const T3 &a3,
const T4 &a4,
const T5 &a5,
const T6 &a6,
const T7 &a7,
const T8 &a8,
const T9 &a9)
907 #endif // _LIBALVALUE_ALVALUE_ALVALUE_H_
TAlValueArray::iterator ITAlValueArray
Iterator to a vector of ALValue.
std::vector< std::string > TStringArray
Vector of std::string.
std::vector< int > TIntArray
Vector of int.
ALValue is a class to manipulate differente value type.
TAlValueBinaryData * asBinary
TAlValueArray::const_iterator CITAlValueArray
Const iterator to a vector of ALValue.
int TALValueInt
Type definition to int.
static ALValue array(const T0 &a0)
double TALValueDouble
Type definition to double.
std::ostream & operator<<(std::ostream &os, const AL::ALValue &a)
Stream operator for ALValue.
std::vector< unsigned char > TAlValueBinaryData
Vector of unsigned char used for binary data.
void arraySetSize(int size)
Specify the size of the array this will call vector::resize.
float TALValueFloat
Type definition to float.
std::vector< ALValue > TAlValueArray
Vector of ALValue.
TAlValueBinaryData::iterator ITAlValueBinaryData
Iterator to a vector of unsigned char used for binary data.
std::vector< float > TFloatArray
Vector of float.
TALValueString * asString
TAlValueBinaryData::const_iterator CITAlValueBinaryData
Const iterator to a vector of unsigned char used for binary data.
bool TALValueBool
Type definition to bool.
int _type
Type of the ALValue.
std::string TALValueString
Type definition to std::string.
unionValue is a union to different type of ALValue.
TAlValueBinaryData * asObject