diff options
Diffstat (limited to 'indra/llmessage/llnamevalue.h')
-rw-r--r-- | indra/llmessage/llnamevalue.h | 92 |
1 files changed, 36 insertions, 56 deletions
diff --git a/indra/llmessage/llnamevalue.h b/indra/llmessage/llnamevalue.h index 7a4c80f3f3..273de475f8 100644 --- a/indra/llmessage/llnamevalue.h +++ b/indra/llmessage/llnamevalue.h @@ -2,45 +2,52 @@ * @file llnamevalue.h * @brief class for defining name value pairs. * - * $LicenseInfo:firstyear=2001&license=viewergpl$ - * - * Copyright (c) 2001-2007, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ #ifndef LL_LLNAMEVALUE_H #define LL_LLNAMEVALUE_H +// As of January 2008, I believe we only use the following name-value +// pairs. This is hard to prove because they are initialized from +// strings. JC +// +// FirstName STRING +// LastName STRING +// AttachPt U32 +// AttachmentItemId STRING +// Title STRING +// AttachmentOffset VEC3 +// AttachmentOrientation VEC3 +// SitObject STRING +// SitPosition VEC3 + #include "string_table.h" #include "llmath.h" #include "v3math.h" #include "lldbstrings.h" class LLNameValue; -typedef void (*TNameValueCallback)(LLNameValue *changed, void **user_data); - -void add_use_callback(char *name, TNameValueCallback ucb, void **user_data); +class LLStringTable; typedef enum e_name_value_types { @@ -61,7 +68,6 @@ typedef enum e_name_value_class NVC_NULL, NVC_READ_ONLY, NVC_READ_WRITE, - NVC_CALLBACK, NVC_EOF } ENameValueClass; @@ -110,17 +116,13 @@ class LLNameValue { public: void baseInit(); - void init(const char *name, const char *data, const char *type, const char *nvclass, const char *nvsendto, - TNameValueCallback nvcb = NULL, void **user_data = NULL); + void init(const char *name, const char *data, const char *type, const char *nvclass, const char *nvsendto ); LLNameValue(); LLNameValue(const char *data); - LLNameValue(const char *name, const char *type, const char *nvclass, - TNameValueCallback nvcb = NULL, void **user_data = NULL); - LLNameValue(const char *name, const char *data, const char *type, const char *nvclass, - TNameValueCallback nvcb = NULL, void **user_data = NULL); - LLNameValue(const char *name, const char *data, const char *type, const char *nvclass, const char *nvsendto, - TNameValueCallback nvcb = NULL, void **user_data = NULL); + LLNameValue(const char *name, const char *type, const char *nvclass ); + LLNameValue(const char *name, const char *data, const char *type, const char *nvclass ); + LLNameValue(const char *name, const char *data, const char *type, const char *nvclass, const char *nvsendto ); ~LLNameValue(); @@ -130,7 +132,6 @@ public: S32 *getS32(); void getVec3(LLVector3 &vec); LLVector3 *getVec3(); - F32 magnitude(); U32 *getU32(); U64 *getU64(); @@ -142,8 +143,8 @@ public: BOOL sendToViewer() const; void callCallback(); - std::string printNameValue(); - std::string printData(); + std::string printNameValue() const; + std::string printData() const; ENameValueType getTypeEnum() const { return mType; } ENameValueClass getClassEnum() const { return mClass; } @@ -157,27 +158,8 @@ public: void setVec3(const LLVector3 &a); void setU32(const U32 a); - BOOL nonzero(); - friend std::ostream& operator<<(std::ostream& s, const LLNameValue &a); - friend LLNameValue &operator+(const LLNameValue &a, const LLNameValue &b); - friend LLNameValue &operator-(const LLNameValue &a, const LLNameValue &b); - friend LLNameValue &operator*(const LLNameValue &a, const LLNameValue &b); - friend LLNameValue &operator/(const LLNameValue &a, const LLNameValue &b); - friend LLNameValue &operator%(const LLNameValue &a, const LLNameValue &b); - friend LLNameValue &operator*(const LLNameValue &a, F32 k); - friend LLNameValue &operator*(F32 k, const LLNameValue &a); - - friend bool operator==(const LLNameValue &a, const LLNameValue &b); - friend bool operator<=(const LLNameValue &a, const LLNameValue &b); - friend bool operator>=(const LLNameValue &a, const LLNameValue &b); - friend bool operator<(const LLNameValue &a, const LLNameValue &b); - friend bool operator>(const LLNameValue &a, const LLNameValue &b); - friend bool operator!=(const LLNameValue &a, const LLNameValue &b); - - friend LLNameValue &operator-(const LLNameValue &a); - private: void printNameValue(std::ostream& s); @@ -193,8 +175,6 @@ public: UNameValueReference mNameValueReference; LLStringTable *mNVNameTable; - TNameValueCallback mNameValueCB; - void **mUserData; }; extern LLStringTable gNVNameTable; |