00001
00032
00033
00034
00035 #include "linden_common.h"
00036
00037 #include "llnamevalue.h"
00038
00039 #include "u64.h"
00040 #include "llstring.h"
00041 #include "llcamera.h"
00042 #include "string_table.h"
00043
00044
00045
00046
00047
00048 enum
00049 {
00050 NV_BUFFER_LEN = 2048,
00051 U64_BUFFER_LEN = 64
00052 };
00053
00054 LLStringTable gNVNameTable(256);
00055
00056 char NameValueTypeStrings[NVT_EOF][NAME_VALUE_TYPE_STRING_LENGTH] =
00057 {
00058 "NULL",
00059 "STRING",
00060 "F32",
00061 "S32",
00062 "VEC3",
00063 "U32",
00064 "CAMERA",
00065 "ASSET",
00066 "U64"
00067 };
00068
00069 char NameValueClassStrings[NVC_EOF][NAME_VALUE_CLASS_STRING_LENGTH] =
00070 {
00071 "NULL",
00072 "R",
00073 "RW"
00074 };
00075
00076 char NameValueSendtoStrings[NVS_EOF][NAME_VALUE_SENDTO_STRING_LENGTH] =
00077 {
00078 "NULL",
00079 "S",
00080 "DS",
00081 "SV",
00082 "DSV"
00083 };
00084
00085
00086
00087
00088
00089
00090 LLNameValue::LLNameValue()
00091 {
00092 baseInit();
00093 }
00094
00095 void LLNameValue::baseInit()
00096 {
00097 mNVNameTable = &gNVNameTable;
00098
00099 mName = NULL;
00100 mNameValueReference.string = NULL;
00101
00102 mType = NVT_NULL;
00103 mStringType = NameValueTypeStrings[NVT_NULL];
00104
00105 mClass = NVC_NULL;
00106 mStringClass = NameValueClassStrings[NVC_NULL];
00107
00108 mSendto = NVS_NULL;
00109 mStringSendto = NameValueSendtoStrings[NVS_NULL];
00110 }
00111
00112 void LLNameValue::init(const char *name, const char *data, const char *type, const char *nvclass, const char *nvsendto)
00113 {
00114 mNVNameTable = &gNVNameTable;
00115
00116 mName = mNVNameTable->addString(name);
00117
00118
00119 mStringType = mNVNameTable->addString(type);
00120 if (!strcmp(mStringType, "STRING"))
00121 {
00122 S32 string_length = (S32)strlen(data);
00123 mType = NVT_STRING;
00124
00125 delete[] mNameValueReference.string;
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140 mNameValueReference.string = new char[string_length + 1];;
00141 strncpy(mNameValueReference.string, data, string_length);
00142
00143 mNameValueReference.string[string_length] = 0;
00144 }
00145 else if (!strcmp(mStringType, "F32"))
00146 {
00147 mType = NVT_F32;
00148 mNameValueReference.f32 = new F32((F32)atof(data));
00149 }
00150 else if (!strcmp(mStringType, "S32"))
00151 {
00152 mType = NVT_S32;
00153 mNameValueReference.s32 = new S32(atoi(data));
00154 }
00155 else if (!strcmp(mStringType, "U64"))
00156 {
00157 mType = NVT_U64;
00158 mNameValueReference.u64 = new U64(str_to_U64(data));
00159 }
00160 else if (!strcmp(mStringType, "VEC3"))
00161 {
00162 mType = NVT_VEC3;
00163 F32 t1, t2, t3;
00164
00165
00166
00167 if (strchr(data, '<'))
00168 {
00169 sscanf(data, "<%f, %f, %f>", &t1, &t2, &t3);
00170 }
00171 else
00172 {
00173 sscanf(data, "%f, %f, %f", &t1, &t2, &t3);
00174 }
00175
00176
00177 if (!llfinite(t1) || !llfinite(t2) || !llfinite(t3))
00178 {
00179 t1 = 0.f;
00180 t2 = 0.f;
00181 t3 = 0.f;
00182 }
00183
00184 mNameValueReference.vec3 = new LLVector3(t1, t2, t3);
00185 }
00186 else if (!strcmp(mStringType, "U32"))
00187 {
00188 mType = NVT_U32;
00189 mNameValueReference.u32 = new U32(atoi(data));
00190 }
00191 else if(!strcmp(mStringType, (const char*)NameValueTypeStrings[NVT_ASSET]))
00192 {
00193
00194
00195 S32 string_length = (S32)strlen(data);
00196 mType = NVT_ASSET;
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211 mNameValueReference.string = new char[string_length + 1];;
00212 strncpy(mNameValueReference.string, data, string_length);
00213
00214 mNameValueReference.string[string_length] = 0;
00215 }
00216 else
00217 {
00218 llwarns << "Unknown name value type string " << mStringType << " for " << mName << llendl;
00219 mType = NVT_NULL;
00220 }
00221
00222
00223
00224 if (!strcmp(nvclass, "R") ||
00225 !strcmp(nvclass, "READ_ONLY"))
00226 {
00227 mClass = NVC_READ_ONLY;
00228 mStringClass = mNVNameTable->addString("R");
00229 }
00230 else if (!strcmp(nvclass, "RW") ||
00231 !strcmp(nvclass, "READ_WRITE"))
00232 {
00233 mClass = NVC_READ_WRITE;
00234 mStringClass = mNVNameTable->addString("RW");
00235 }
00236 else
00237 {
00238
00239 mClass = NVC_NULL;
00240 mStringClass = mNVNameTable->addString(nvclass);
00241 }
00242
00243
00244 if (!strcmp(nvsendto, "S") ||
00245 !strcmp(nvsendto, "SIM"))
00246 {
00247 mSendto = NVS_SIM;
00248 mStringSendto = mNVNameTable->addString("S");
00249 }
00250 else if (!strcmp(nvsendto, "DS") ||
00251 !strcmp(nvsendto, "SIM_SPACE"))
00252 {
00253 mSendto = NVS_DATA_SIM;
00254 mStringSendto = mNVNameTable->addString("DS");
00255 }
00256 else if (!strcmp(nvsendto, "SV") ||
00257 !strcmp(nvsendto, "SIM_VIEWER"))
00258 {
00259 mSendto = NVS_SIM_VIEWER;
00260 mStringSendto = mNVNameTable->addString("SV");
00261 }
00262 else if (!strcmp(nvsendto, "DSV") ||
00263 !strcmp(nvsendto, "SIM_SPACE_VIEWER"))
00264 {
00265 mSendto = NVS_DATA_SIM_VIEWER;
00266 mStringSendto = mNVNameTable->addString("DSV");
00267 }
00268 else
00269 {
00270 llwarns << "LLNameValue::init() - unknown sendto field "
00271 << nvsendto << " for NV " << mName << llendl;
00272 mSendto = NVS_NULL;
00273 mStringSendto = mNVNameTable->addString("S");
00274 }
00275
00276 }
00277
00278
00279 LLNameValue::LLNameValue(const char *name, const char *data, const char *type, const char *nvclass)
00280 {
00281 baseInit();
00282
00283 init(name, data, type, nvclass, "SIM");
00284 }
00285
00286
00287 LLNameValue::LLNameValue(const char *name, const char *data, const char *type, const char *nvclass, const char *nvsendto)
00288 {
00289 baseInit();
00290 init(name, data, type, nvclass, nvsendto);
00291 }
00292
00293
00294
00295
00296 LLNameValue::LLNameValue(const char *name, const char *type, const char *nvclass)
00297 {
00298 baseInit();
00299 mName = mNVNameTable->addString(name);
00300
00301
00302 mStringType = mNVNameTable->addString(type);
00303 if (!strcmp(mStringType, "STRING"))
00304 {
00305 mType = NVT_STRING;
00306 mNameValueReference.string = NULL;
00307 }
00308 else if (!strcmp(mStringType, "F32"))
00309 {
00310 mType = NVT_F32;
00311 mNameValueReference.f32 = NULL;
00312 }
00313 else if (!strcmp(mStringType, "S32"))
00314 {
00315 mType = NVT_S32;
00316 mNameValueReference.s32 = NULL;
00317 }
00318 else if (!strcmp(mStringType, "VEC3"))
00319 {
00320 mType = NVT_VEC3;
00321 mNameValueReference.vec3 = NULL;
00322 }
00323 else if (!strcmp(mStringType, "U32"))
00324 {
00325 mType = NVT_U32;
00326 mNameValueReference.u32 = NULL;
00327 }
00328 else if (!strcmp(mStringType, "U64"))
00329 {
00330 mType = NVT_U64;
00331 mNameValueReference.u64 = NULL;
00332 }
00333 else if(!strcmp(mStringType, (const char*)NameValueTypeStrings[NVT_ASSET]))
00334 {
00335 mType = NVT_ASSET;
00336 mNameValueReference.string = NULL;
00337 }
00338 else
00339 {
00340 mType = NVT_NULL;
00341 llinfos << "Unknown name-value type " << mStringType << llendl;
00342 }
00343
00344
00345 mStringClass = mNVNameTable->addString(nvclass);
00346 if (!strcmp(mStringClass, "READ_ONLY"))
00347 {
00348 mClass = NVC_READ_ONLY;
00349 }
00350 else if (!strcmp(mStringClass, "READ_WRITE"))
00351 {
00352 mClass = NVC_READ_WRITE;
00353 }
00354 else
00355 {
00356 mClass = NVC_NULL;
00357 }
00358
00359
00360 mStringSendto = mNVNameTable->addString("SIM");
00361 mSendto = NVS_SIM;
00362 }
00363
00364
00365
00366
00367 LLNameValue::LLNameValue(const char *data)
00368 {
00369 baseInit();
00370 static char name[NV_BUFFER_LEN];
00371 static char type[NV_BUFFER_LEN];
00372 static char nvclass[NV_BUFFER_LEN];
00373 static char nvsendto[NV_BUFFER_LEN];
00374 static char nvdata[NV_BUFFER_LEN];
00375
00376 S32 i;
00377
00378 S32 character_count = 0;
00379 S32 length = 0;
00380
00381
00382 while (1)
00383 {
00384 if ( (*(data + character_count) == ' ')
00385 ||(*(data + character_count) == '\n')
00386 ||(*(data + character_count) == '\t')
00387 ||(*(data + character_count) == '\r'))
00388 {
00389 character_count++;
00390 }
00391 else
00392 {
00393 break;
00394 }
00395 }
00396
00397
00398 sscanf((data + character_count), "%2047s", name);
00399
00400
00401 length = (S32)strlen(name);
00402 name[length] = 0;
00403 character_count += length;
00404
00405
00406 while (1)
00407 {
00408 if ( (*(data + character_count) == ' ')
00409 ||(*(data + character_count) == '\n')
00410 ||(*(data + character_count) == '\t')
00411 ||(*(data + character_count) == '\r'))
00412 {
00413 character_count++;
00414 }
00415 else
00416 {
00417 break;
00418 }
00419 }
00420
00421
00422 sscanf((data + character_count), "%2047s", type);
00423
00424
00425 length = (S32)strlen(type);
00426 type[length] = 0;
00427 character_count += length;
00428
00429
00430 while (1)
00431 {
00432 if ( (*(data + character_count) == ' ')
00433 ||(*(data + character_count) == '\n')
00434 ||(*(data + character_count) == '\t')
00435 ||(*(data + character_count) == '\r'))
00436 {
00437 character_count++;
00438 }
00439 else
00440 {
00441 break;
00442 }
00443 }
00444
00445
00446 for (i = NVC_READ_ONLY; i < NVC_EOF; i++)
00447 {
00448 if (!strncmp(NameValueClassStrings[i], data + character_count, strlen(NameValueClassStrings[i])))
00449 {
00450 break;
00451 }
00452 }
00453
00454 if (i != NVC_EOF)
00455 {
00456
00457
00458 sscanf((data + character_count), "%2047s", nvclass);
00459
00460
00461 length = (S32)strlen(nvclass);
00462 nvclass[length] = 0;
00463 character_count += length;
00464
00465
00466 while (1)
00467 {
00468 if ( (*(data + character_count) == ' ')
00469 ||(*(data + character_count) == '\n')
00470 ||(*(data + character_count) == '\t')
00471 ||(*(data + character_count) == '\r'))
00472 {
00473 character_count++;
00474 }
00475 else
00476 {
00477 break;
00478 }
00479 }
00480 }
00481 else
00482 {
00483
00484 strncpy(nvclass, "READ_WRITE", sizeof(nvclass) -1);
00485 nvclass[sizeof(nvclass) -1] = '\0';
00486 }
00487
00488
00489 for (i = NVS_SIM; i < NVS_EOF; i++)
00490 {
00491 if (!strncmp(NameValueSendtoStrings[i], data + character_count, strlen(NameValueSendtoStrings[i])))
00492 {
00493 break;
00494 }
00495 }
00496
00497 if (i != NVS_EOF)
00498 {
00499
00500 sscanf((data + character_count), "%2047s", nvsendto);
00501
00502
00503 length = (S32)strlen(nvsendto);
00504 nvsendto[length] = 0;
00505 character_count += length;
00506
00507
00508 while (1)
00509 {
00510 if ( (*(data + character_count) == ' ')
00511 ||(*(data + character_count) == '\n')
00512 ||(*(data + character_count) == '\t')
00513 ||(*(data + character_count) == '\r'))
00514 {
00515 character_count++;
00516 }
00517 else
00518 {
00519 break;
00520 }
00521 }
00522 }
00523 else
00524 {
00525
00526 strncpy(nvsendto, "SIM", sizeof(nvsendto) -1);
00527 nvsendto[sizeof(nvsendto) -1] ='\0';
00528 }
00529
00530
00531
00532 length = 0;
00533
00534 while ( (*(nvdata + length++) = *(data + character_count++)) )
00535 ;
00536
00537 init(name, nvdata, type, nvclass, nvsendto);
00538 }
00539
00540
00541 LLNameValue::~LLNameValue()
00542 {
00543 mNVNameTable->removeString(mName);
00544 mName = NULL;
00545
00546 switch(mType)
00547 {
00548 case NVT_STRING:
00549 case NVT_ASSET:
00550 delete [] mNameValueReference.string;
00551 mNameValueReference.string = NULL;
00552 break;
00553 case NVT_F32:
00554 delete mNameValueReference.f32;
00555 mNameValueReference.string = NULL;
00556 break;
00557 case NVT_S32:
00558 delete mNameValueReference.s32;
00559 mNameValueReference.string = NULL;
00560 break;
00561 case NVT_VEC3:
00562 delete mNameValueReference.vec3;
00563 mNameValueReference.string = NULL;
00564 break;
00565 case NVT_U32:
00566 delete mNameValueReference.u32;
00567 mNameValueReference.u32 = NULL;
00568 break;
00569 case NVT_U64:
00570 delete mNameValueReference.u64;
00571 mNameValueReference.u64 = NULL;
00572 break;
00573 default:
00574 break;
00575 }
00576
00577 delete[] mNameValueReference.string;
00578 mNameValueReference.string = NULL;
00579 }
00580
00581 char *LLNameValue::getString()
00582 {
00583 if (mType == NVT_STRING)
00584 {
00585 return mNameValueReference.string;
00586 }
00587 else
00588 {
00589 llerrs << mName << " not a string!" << llendl;
00590 return NULL;
00591 }
00592 }
00593
00594 const char *LLNameValue::getAsset() const
00595 {
00596 if (mType == NVT_ASSET)
00597 {
00598 return mNameValueReference.string;
00599 }
00600 else
00601 {
00602 llerrs << mName << " not an asset!" << llendl;
00603 return NULL;
00604 }
00605 }
00606
00607 F32 *LLNameValue::getF32()
00608 {
00609 if (mType == NVT_F32)
00610 {
00611 return mNameValueReference.f32;
00612 }
00613 else
00614 {
00615 llerrs << mName << " not a F32!" << llendl;
00616 return NULL;
00617 }
00618 }
00619
00620 S32 *LLNameValue::getS32()
00621 {
00622 if (mType == NVT_S32)
00623 {
00624 return mNameValueReference.s32;
00625 }
00626 else
00627 {
00628 llerrs << mName << " not a S32!" << llendl;
00629 return NULL;
00630 }
00631 }
00632
00633 U32 *LLNameValue::getU32()
00634 {
00635 if (mType == NVT_U32)
00636 {
00637 return mNameValueReference.u32;
00638 }
00639 else
00640 {
00641 llerrs << mName << " not a U32!" << llendl;
00642 return NULL;
00643 }
00644 }
00645
00646 U64 *LLNameValue::getU64()
00647 {
00648 if (mType == NVT_U64)
00649 {
00650 return mNameValueReference.u64;
00651 }
00652 else
00653 {
00654 llerrs << mName << " not a U64!" << llendl;
00655 return NULL;
00656 }
00657 }
00658
00659 void LLNameValue::getVec3(LLVector3 &vec)
00660 {
00661 if (mType == NVT_VEC3)
00662 {
00663 vec = *mNameValueReference.vec3;
00664 }
00665 else
00666 {
00667 llerrs << mName << " not a Vec3!" << llendl;
00668 }
00669 }
00670
00671 LLVector3 *LLNameValue::getVec3()
00672 {
00673 if (mType == NVT_VEC3)
00674 {
00675 return (mNameValueReference.vec3);
00676 }
00677 else
00678 {
00679 llerrs << mName << " not a Vec3!" << llendl;
00680 return NULL;
00681 }
00682 }
00683
00684
00685 BOOL LLNameValue::sendToData() const
00686 {
00687 return (mSendto == NVS_DATA_SIM || mSendto == NVS_DATA_SIM_VIEWER);
00688 }
00689
00690
00691 BOOL LLNameValue::sendToViewer() const
00692 {
00693 return (mSendto == NVS_SIM_VIEWER || mSendto == NVS_DATA_SIM_VIEWER);
00694 }
00695
00696
00697 LLNameValue &LLNameValue::operator=(const LLNameValue &a)
00698 {
00699 if (mType != a.mType)
00700 {
00701 return *this;
00702 }
00703 if (mClass == NVC_READ_ONLY)
00704 return *this;
00705
00706 switch(a.mType)
00707 {
00708 case NVT_STRING:
00709 case NVT_ASSET:
00710 if (mNameValueReference.string)
00711 delete [] mNameValueReference.string;
00712
00713 mNameValueReference.string = new char [strlen(a.mNameValueReference.string) + 1];
00714 if(mNameValueReference.string != NULL)
00715 {
00716 strcpy(mNameValueReference.string, a.mNameValueReference.string);
00717 }
00718 break;
00719 case NVT_F32:
00720 *mNameValueReference.f32 = *a.mNameValueReference.f32;
00721 break;
00722 case NVT_S32:
00723 *mNameValueReference.s32 = *a.mNameValueReference.s32;
00724 break;
00725 case NVT_VEC3:
00726 *mNameValueReference.vec3 = *a.mNameValueReference.vec3;
00727 break;
00728 case NVT_U32:
00729 *mNameValueReference.u32 = *a.mNameValueReference.u32;
00730 break;
00731 case NVT_U64:
00732 *mNameValueReference.u64 = *a.mNameValueReference.u64;
00733 break;
00734 default:
00735 llerrs << "Unknown Name value type " << (U32)a.mType << llendl;
00736 break;
00737 }
00738
00739 return *this;
00740 }
00741
00742 void LLNameValue::setString(const char *a)
00743 {
00744 if (mClass == NVC_READ_ONLY)
00745 return;
00746
00747 switch(mType)
00748 {
00749 case NVT_STRING:
00750 if (a)
00751 {
00752 if (mNameValueReference.string)
00753 {
00754 delete [] mNameValueReference.string;
00755 }
00756
00757 mNameValueReference.string = new char [strlen(a) + 1];
00758 if(mNameValueReference.string != NULL)
00759 {
00760 strcpy(mNameValueReference.string, a);
00761 }
00762 }
00763 else
00764 {
00765 if (mNameValueReference.string)
00766 delete [] mNameValueReference.string;
00767
00768 mNameValueReference.string = new char [1];
00769 mNameValueReference.string[0] = 0;
00770 }
00771 break;
00772 default:
00773 break;
00774 }
00775
00776 return;
00777 }
00778
00779
00780 void LLNameValue::setAsset(const char *a)
00781 {
00782 if (mClass == NVC_READ_ONLY)
00783 return;
00784
00785 switch(mType)
00786 {
00787 case NVT_ASSET:
00788 if (a)
00789 {
00790 if (mNameValueReference.string)
00791 {
00792 delete [] mNameValueReference.string;
00793 }
00794 mNameValueReference.string = new char [strlen(a) + 1];
00795 if(mNameValueReference.string != NULL)
00796 {
00797 strcpy(mNameValueReference.string, a);
00798 }
00799 }
00800 else
00801 {
00802 if (mNameValueReference.string)
00803 delete [] mNameValueReference.string;
00804
00805 mNameValueReference.string = new char [1];
00806 mNameValueReference.string[0] = 0;
00807 }
00808 break;
00809 default:
00810 break;
00811 }
00812 }
00813
00814
00815 void LLNameValue::setF32(const F32 a)
00816 {
00817 if (mClass == NVC_READ_ONLY)
00818 return;
00819
00820 switch(mType)
00821 {
00822 case NVT_F32:
00823 *mNameValueReference.f32 = a;
00824 break;
00825 default:
00826 break;
00827 }
00828
00829 return;
00830 }
00831
00832
00833 void LLNameValue::setS32(const S32 a)
00834 {
00835 if (mClass == NVC_READ_ONLY)
00836 return;
00837
00838 switch(mType)
00839 {
00840 case NVT_S32:
00841 *mNameValueReference.s32 = a;
00842 break;
00843 case NVT_U32:
00844 *mNameValueReference.u32 = a;
00845 break;
00846 case NVT_F32:
00847 *mNameValueReference.f32 = (F32)a;
00848 break;
00849 default:
00850 break;
00851 }
00852
00853 return;
00854 }
00855
00856
00857 void LLNameValue::setU32(const U32 a)
00858 {
00859 if (mClass == NVC_READ_ONLY)
00860 return;
00861
00862 switch(mType)
00863 {
00864 case NVT_S32:
00865 *mNameValueReference.s32 = a;
00866 break;
00867 case NVT_U32:
00868 *mNameValueReference.u32 = a;
00869 break;
00870 case NVT_F32:
00871 *mNameValueReference.f32 = (F32)a;
00872 break;
00873 default:
00874 llerrs << "NameValue: Trying to set U32 into a " << mStringType << ", unknown conversion" << llendl;
00875 break;
00876 }
00877 return;
00878 }
00879
00880
00881 void LLNameValue::setVec3(const LLVector3 &a)
00882 {
00883 if (mClass == NVC_READ_ONLY)
00884 return;
00885
00886 switch(mType)
00887 {
00888 case NVT_VEC3:
00889 *mNameValueReference.vec3 = a;
00890 break;
00891 default:
00892 llerrs << "NameValue: Trying to set LLVector3 into a " << mStringType << ", unknown conversion" << llendl;
00893 break;
00894 }
00895 return;
00896 }
00897
00898
00899 std::string LLNameValue::printNameValue()
00900 {
00901 std::string buffer;
00902 buffer = llformat("%s %s %s %s ", mName, mStringType, mStringClass, mStringSendto);
00903 buffer += printData();
00904
00905 return buffer;
00906 }
00907
00908 std::string LLNameValue::printData()
00909 {
00910 std::string buffer;
00911 switch(mType)
00912 {
00913 case NVT_STRING:
00914 case NVT_ASSET:
00915 buffer = mNameValueReference.string;
00916 break;
00917 case NVT_F32:
00918 buffer = llformat("%f", *mNameValueReference.f32);
00919 break;
00920 case NVT_S32:
00921 buffer = llformat("%d", *mNameValueReference.s32);
00922 break;
00923 case NVT_U32:
00924 buffer = llformat("%u", *mNameValueReference.u32);
00925 break;
00926 case NVT_U64:
00927 {
00928 char u64_string[U64_BUFFER_LEN];
00929 U64_to_str(*mNameValueReference.u64, u64_string, sizeof(u64_string));
00930 buffer = u64_string;
00931 }
00932 break;
00933 case NVT_VEC3:
00934 buffer = llformat( "%f, %f, %f", mNameValueReference.vec3->mV[VX], mNameValueReference.vec3->mV[VY], mNameValueReference.vec3->mV[VZ]);
00935 break;
00936 default:
00937 llerrs << "Trying to print unknown NameValue type " << mStringType << llendl;
00938 break;
00939 }
00940 return buffer;
00941 }
00942
00943 std::ostream& operator<<(std::ostream& s, const LLNameValue &a)
00944 {
00945 switch(a.mType)
00946 {
00947 case NVT_STRING:
00948 case NVT_ASSET:
00949 s << a.mNameValueReference.string;
00950 break;
00951 case NVT_F32:
00952 s << (*a.mNameValueReference.f32);
00953 break;
00954 case NVT_S32:
00955 s << *(a.mNameValueReference.s32);
00956 break;
00957 case NVT_U32:
00958 s << *(a.mNameValueReference.u32);
00959 break;
00960 case NVT_U64:
00961 {
00962 char u64_string[U64_BUFFER_LEN];
00963 U64_to_str(*a.mNameValueReference.u64, u64_string, sizeof(u64_string));
00964 s << u64_string;
00965 }
00966 case NVT_VEC3:
00967 s << *(a.mNameValueReference.vec3);
00968 break;
00969 default:
00970 llerrs << "Trying to print unknown NameValue type " << a.mStringType << llendl;
00971 break;
00972 }
00973 return s;
00974 }
00975