llsdutil.h

Go to the documentation of this file.
00001 
00034 #ifndef LL_LLSDUTIL_H
00035 #define LL_LLSDUTIL_H
00036 
00037 #include "llsd.h"
00038 #include "../llmath/v3math.h"
00039 #include "../llmath/v4math.h"
00040 #include "../llmath/v3dmath.h"
00041 #include "../llmath/v2math.h"
00042 #include "../llmath/llquaternion.h"
00043 #include "../llmath/v4color.h"
00044 #include "../llprimitive/lltextureanim.h"
00045 
00046 // vector3
00047 LLSD ll_sd_from_vector3(const LLVector3& vec);
00048 LLVector3 ll_vector3_from_sd(const LLSD& sd, S32 start_index = 0);
00049 
00050 // vector4
00051 LLSD ll_sd_from_vector4(const LLVector4& vec);
00052 LLVector4 ll_vector4_from_sd(const LLSD& sd, S32 start_index = 0);
00053 
00054 // vector3d (double)
00055 LLSD ll_sd_from_vector3d(const LLVector3d& vec);
00056 LLVector3d ll_vector3d_from_sd(const LLSD& sd, S32 start_index = 0);
00057 
00058 // vector2
00059 LLSD ll_sd_from_vector2(const LLVector2& vec);
00060 LLVector2 ll_vector2_from_sd(const LLSD& sd);
00061 
00062 // Quaternion
00063 LLSD ll_sd_from_quaternion(const LLQuaternion& quat);
00064 LLQuaternion ll_quaternion_from_sd(const LLSD& sd);
00065 
00066 // color4
00067 LLSD ll_sd_from_color4(const LLColor4& c);
00068 LLColor4 ll_color4_from_sd(const LLSD& sd);
00069 
00070 // U32
00071 LLSD ll_sd_from_U32(const U32);
00072 U32 ll_U32_from_sd(const LLSD& sd);
00073 
00074 // U64
00075 LLSD ll_sd_from_U64(const U64);
00076 U64 ll_U64_from_sd(const LLSD& sd);
00077 
00078 // IP Address
00079 LLSD ll_sd_from_ipaddr(const U32);
00080 U32 ll_ipaddr_from_sd(const LLSD& sd);
00081 
00082 // Binary to string
00083 LLSD ll_string_from_binary(const LLSD& sd);
00084 
00085 //String to binary
00086 LLSD ll_binary_from_string(const LLSD& sd);
00087 
00088 // Serializes sd to static buffer and returns pointer, useful for gdb debugging.
00089 char* ll_print_sd(const LLSD& sd);
00090 
00091 // Serializes sd to static buffer and returns pointer, using "pretty printing" mode.
00092 char* ll_pretty_print_sd(const LLSD& sd);
00093 
00094 //compares the structure of an LLSD to a template LLSD and stores the
00095 //"valid" values in a 3rd LLSD. Default values
00096 //are pulled from the template.  Ordering of arrays matters
00097 //Returns false if the test is of same type but values differ in type
00098 //Otherwise, returns true
00099 BOOL compare_llsd_with_template(
00100         const LLSD& llsd_to_test,
00101         const LLSD& template_llsd,
00102         LLSD& resultant_llsd);
00103 
00104 // Simple function to copy data out of input & output iterators if
00105 // there is no need for casting.
00106 template<typename Input> LLSD llsd_copy_array(Input iter, Input end)
00107 {
00108         LLSD dest;
00109         for (; iter != end; ++iter)
00110         {
00111                 dest.append(*iter);
00112         }
00113         return dest;
00114 }
00115 
00116 #endif // LL_LLSDUTIL_H

Generated on Fri May 16 08:32:08 2008 for SecondLife by  doxygen 1.5.5