aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/lluistring.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/llui/lluistring.h
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/llui/lluistring.h')
-rw-r--r--linden/indra/llui/lluistring.h34
1 files changed, 17 insertions, 17 deletions
diff --git a/linden/indra/llui/lluistring.h b/linden/indra/llui/lluistring.h
index e8a86f4..b6c715f 100644
--- a/linden/indra/llui/lluistring.h
+++ b/linden/indra/llui/lluistring.h
@@ -1,7 +1,7 @@
1/** 1/**
2 * @file lluistring.h 2 * @file lluistring.h
3 * @author: Steve Bennetts 3 * @author: Steve Bennetts
4 * @brief A fancy wrapper for LLString supporting argument substitutions. 4 * @brief A fancy wrapper for std::string supporting argument substitutions.
5 * 5 *
6 * $LicenseInfo:firstyear=2006&license=viewergpl$ 6 * $LicenseInfo:firstyear=2006&license=viewergpl$
7 * 7 *
@@ -47,15 +47,15 @@
47// LLUIString mMessage("Welcome [USERNAME] to [SECONDLIFE]!"); 47// LLUIString mMessage("Welcome [USERNAME] to [SECONDLIFE]!");
48// mMessage.setArg("[USERNAME]", "Steve"); 48// mMessage.setArg("[USERNAME]", "Steve");
49// mMessage.setArg("[SECONDLIFE]", "Second Life"); 49// mMessage.setArg("[SECONDLIFE]", "Second Life");
50// llinfos << mMessage.getString().c_str() << llendl; // outputs "Welcome Steve to Second Life" 50// llinfos << mMessage.getString() << llendl; // outputs "Welcome Steve to Second Life"
51// mMessage.setArg("[USERNAME]", "Joe"); 51// mMessage.setArg("[USERNAME]", "Joe");
52// llinfos << mMessage.getString().c_str() << llendl; // outputs "Welcome Joe to Second Life" 52// llinfos << mMessage.getString() << llendl; // outputs "Welcome Joe to Second Life"
53// mMessage = "Recepción a la [SECONDLIFE] [USERNAME]" 53// mMessage = "Recepción a la [SECONDLIFE] [USERNAME]"
54// mMessage.setArg("[SECONDLIFE]", "Segunda Vida"); 54// mMessage.setArg("[SECONDLIFE]", "Segunda Vida");
55// llinfos << mMessage.getString().c_str() << llendl; // outputs "Recepción a la Segunda Vida Joe" 55// llinfos << mMessage.getString() << llendl; // outputs "Recepción a la Segunda Vida Joe"
56 56
57// Implementation Notes: 57// Implementation Notes:
58// Attempting to have operator[](const LLString& s) return mArgs[s] fails because we have 58// Attempting to have operator[](const std::string& s) return mArgs[s] fails because we have
59// to call format() after the assignment happens. 59// to call format() after the assignment happens.
60 60
61class LLUIString 61class LLUIString
@@ -64,17 +64,17 @@ public:
64 // These methods all perform appropriate argument substitution 64 // These methods all perform appropriate argument substitution
65 // and modify mOrig where appropriate 65 // and modify mOrig where appropriate
66 LLUIString() {} 66 LLUIString() {}
67 LLUIString(const LLString& instring, const LLString::format_map_t& args); 67 LLUIString(const std::string& instring, const LLStringUtil::format_map_t& args);
68 LLUIString(const LLString& instring) { assign(instring); } 68 LLUIString(const std::string& instring) { assign(instring); }
69 69
70 void assign(const LLString& instring); 70 void assign(const std::string& instring);
71 LLUIString& operator=(const LLString& s) { assign(s); return *this; } 71 LLUIString& operator=(const std::string& s) { assign(s); return *this; }
72 72
73 void setArgList(const LLString::format_map_t& args); 73 void setArgList(const LLStringUtil::format_map_t& args);
74 void setArg(const LLString& key, const LLString& replacement); 74 void setArg(const std::string& key, const std::string& replacement);
75 75
76 const LLString& getString() const { return mResult; } 76 const std::string& getString() const { return mResult; }
77 operator LLString() const { return mResult; } 77 operator std::string() const { return mResult; }
78 78
79 const LLWString& getWString() const { return mWResult; } 79 const LLWString& getWString() const { return mWResult; }
80 operator LLWString() const { return mWResult; } 80 operator LLWString() const { return mWResult; }
@@ -92,15 +92,15 @@ public:
92 void insert(S32 charidx, const LLWString& wchars); 92 void insert(S32 charidx, const LLWString& wchars);
93 void replace(S32 charidx, llwchar wc); 93 void replace(S32 charidx, llwchar wc);
94 94
95 static const LLString::format_map_t sNullArgs; 95 static const LLStringUtil::format_map_t sNullArgs;
96 96
97private: 97private:
98 void format(); 98 void format();
99 99
100 LLString mOrig; 100 std::string mOrig;
101 LLString mResult; 101 std::string mResult;
102 LLWString mWResult; // for displaying 102 LLWString mWResult; // for displaying
103 LLString::format_map_t mArgs; 103 LLStringUtil::format_map_t mArgs;
104}; 104};
105 105
106#endif // LL_LLUISTRING_H 106#endif // LL_LLUISTRING_H