diff options
author | Christian Goetze <cg@lindenlab.com> | 2007-10-10 00:01:43 +0000 |
---|---|---|
committer | Christian Goetze <cg@lindenlab.com> | 2007-10-10 00:01:43 +0000 |
commit | 5ec8bbbe2244ea70d8aa74b5c572351632699425 (patch) | |
tree | 12a4e92720c531105a21ef4f9f363b8572d72a3a /indra/llinventory | |
parent | b3b62c3b9ef32c4dbcae51cd3ef582734d5717bb (diff) |
svn merge -r71238:71367 svn+ssh://svn/svn/linden/branches/maint-ui-qa3
Diffstat (limited to 'indra/llinventory')
-rw-r--r-- | indra/llinventory/llparcel.cpp | 43 | ||||
-rw-r--r-- | indra/llinventory/llparcel.h | 26 | ||||
-rw-r--r-- | indra/llinventory/llpermissions.cpp | 6 | ||||
-rw-r--r-- | indra/llinventory/llpermissions.h | 1 |
4 files changed, 33 insertions, 43 deletions
diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp index 92049c068b..3a67385030 100644 --- a/indra/llinventory/llparcel.cpp +++ b/indra/llinventory/llparcel.cpp @@ -259,42 +259,25 @@ void LLParcel::overrideParcelFlags(U32 flags) mParcelFlags = flags; } -void set_std_string(const char* src, std::string& dest) -{ - if(src) - { - dest.assign(src); - } - else - { -#if (LL_LINUX && __GNUC__ < 3) - dest.assign(std::string("")); -#else - dest.clear(); -#endif - } -} - -void LLParcel::setName(const char* name) +void LLParcel::setName(const LLString& name) { // The escaping here must match the escaping in the database // abstraction layer. - set_std_string(name, mName); + mName = name; LLStringFn::replace_nonprintable(mName, LL_UNKNOWN_CHAR); } -void LLParcel::setDesc(const char* desc) +void LLParcel::setDesc(const LLString& desc) { // The escaping here must match the escaping in the database // abstraction layer. - set_std_string(desc, mDesc); + mDesc = desc; mDesc = rawstr_to_utf8(mDesc); } -void LLParcel::setMusicURL(const char* url) +void LLParcel::setMusicURL(const LLString& url) { - set_std_string(url, mMusicURL); - + mMusicURL = url; // The escaping here must match the escaping in the database // abstraction layer. // This should really filter the url in some way. Other than @@ -302,10 +285,9 @@ void LLParcel::setMusicURL(const char* url) LLStringFn::replace_nonprintable(mMusicURL, LL_UNKNOWN_CHAR); } -void LLParcel::setMediaURL(const char* url) +void LLParcel::setMediaURL(const LLString& url) { - set_std_string(url, mMediaURL); - + mMediaURL = url; // The escaping here must match the escaping in the database // abstraction layer if it's ever added. // This should really filter the url in some way. Other than @@ -571,19 +553,19 @@ BOOL LLParcel::importStream(std::istream& input_stream) } else if ("name" == keyword) { - setName( value.c_str() ); + setName( value ); } else if ("desc" == keyword) { - setDesc( value.c_str() ); + setDesc( value ); } else if ("music_url" == keyword) { - setMusicURL( value.c_str() ); + setMusicURL( value ); } else if ("media_url" == keyword) { - setMediaURL( value.c_str() ); + setMediaURL( value ); } else if ("media_id" == keyword) { @@ -1838,3 +1820,4 @@ LLParcel::ECategory category_ui_string_to_category(const char* s) return LLParcel::C_ANY; } + diff --git a/indra/llinventory/llparcel.h b/indra/llinventory/llparcel.h index efabde3358..9c6300811b 100644 --- a/indra/llinventory/llparcel.h +++ b/indra/llinventory/llparcel.h @@ -203,10 +203,10 @@ public: // MANIPULATORS void generateNewID() { mID.generate(); } - void setName(const char* name); - void setDesc(const char* desc); - void setMusicURL(const char* url); - void setMediaURL(const char* url); + void setName(const LLString& name); + void setDesc(const LLString& desc); + void setMusicURL(const LLString& url); + void setMediaURL(const LLString& url); void setMediaID(const LLUUID& id) { mMediaID = id; } void setMediaAutoScale ( U8 flagIn ) { mMediaAutoScale = flagIn; } virtual void setLocalID(S32 local_id); @@ -256,7 +256,7 @@ public: void setDrawDistance(F32 dist) { mDrawDistance = dist; } void setSalePrice(S32 price) { mSalePrice = price; } void setGroupID(const LLUUID& id) { mGroupID = id; } - //void setGroupName(const char* s) { mGroupName.assign(s); } + //void setGroupName(const LLString& s) { mGroupName.assign(s); } void setPassPrice(S32 price) { mPassPrice = price; } void setPassHours(F32 hours) { mPassHours = hours; } @@ -292,10 +292,10 @@ public: // ACCESSORS const LLUUID& getID() const { return mID; } - const char* getName() const { return mName.c_str(); } - const char* getDesc() const { return mDesc.c_str(); } - const char* getMusicURL() const { return mMusicURL.c_str(); } - const char* getMediaURL() const { return mMediaURL.c_str(); } + const LLString& getName() const { return mName; } + const LLString& getDesc() const { return mDesc; } + const LLString& getMusicURL() const { return mMusicURL; } + const LLString& getMediaURL() const { return mMediaURL; } const LLUUID& getMediaID() const { return mMediaID; } U8 getMediaAutoScale() const { return mMediaAutoScale; } S32 getLocalID() const { return mLocalID; } @@ -567,10 +567,10 @@ protected: F32 mDrawDistance; U32 mParcelFlags; S32 mSalePrice; // linden dollars - std::string mName; - std::string mDesc; - std::string mMusicURL; - std::string mMediaURL; + LLString mName; + LLString mDesc; + LLString mMusicURL; + LLString mMediaURL; U8 mMediaAutoScale; LLUUID mMediaID; S32 mPassPrice; diff --git a/indra/llinventory/llpermissions.cpp b/indra/llinventory/llpermissions.cpp index 4b44fc24f6..8f9f73d0bd 100644 --- a/indra/llinventory/llpermissions.cpp +++ b/indra/llinventory/llpermissions.cpp @@ -1143,6 +1143,12 @@ void mask_to_string(U32 mask, char* str) *str = '\0'; } +std::string mask_to_string(U32 mask) +{ + char str[16]; + mask_to_string(mask, str); + return std::string(str); +} ///---------------------------------------------------------------------------- /// exported functions diff --git a/indra/llinventory/llpermissions.h b/indra/llinventory/llpermissions.h index ab12abb9ed..9370d6480b 100644 --- a/indra/llinventory/llpermissions.h +++ b/indra/llinventory/llpermissions.h @@ -41,6 +41,7 @@ // prototypes class LLMessageSystem; extern void mask_to_string(U32 mask, char* str); +extern std::string mask_to_string(U32 mask); template<class T> class LLMetaClassT; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |