PageRenderTime 19ms CodeModel.GetById 15ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/llui/llresmgr.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 77 lines | 38 code | 14 blank | 25 comment | 0 complexity | b935a5bee8aa99cc2ec0e794a096a5ca MD5 | raw file
 1/** 
 2 * @file llresmgr.h
 3 * @brief Localized resource manager
 4 *
 5 * $LicenseInfo:firstyear=2001&license=viewerlgpl$
 6 * Second Life Viewer Source Code
 7 * Copyright (C) 2010, Linden Research, Inc.
 8 * 
 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation;
12 * version 2.1 of the License only.
13 * 
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * Lesser General Public License for more details.
18 * 
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 * 
23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
24 * $/LicenseInfo$
25 */
26
27
28#ifndef LL_LLRESMGR_H
29#define LL_LLRESMGR_H
30
31#include "locale.h"
32#include "stdtypes.h"
33#include "llstring.h"
34#include "llsingleton.h"
35
36enum LLLOCALE_ID
37{
38	LLLOCALE_USA,
39	LLLOCALE_UK,
40	LLLOCALE_COUNT	// Number of values in this enum.  Keep at end.
41};
42
43class LLResMgr : public LLSingleton<LLResMgr>
44{
45public:
46	LLResMgr();
47
48	void				setLocale( LLLOCALE_ID locale_id );
49	LLLOCALE_ID			getLocale() const						{ return mLocale; }
50
51	char				getDecimalPoint() const;
52	char				getThousandsSeparator() const;
53
54	char				getMonetaryDecimalPoint() const;	
55	char				getMonetaryThousandsSeparator() const;
56	std::string			getMonetaryString( S32 input ) const;
57	void				getIntegerString( std::string& output, S32 input ) const;
58
59
60private:
61	LLLOCALE_ID			mLocale;
62};
63
64class LLLocale
65{
66public:
67	LLLocale(const std::string& locale_string);
68	virtual ~LLLocale();
69
70	static const std::string USER_LOCALE;
71	static const std::string SYSTEM_LOCALE;
72
73private:
74	std::string	mPrevLocaleString;
75};
76
77#endif  // LL_RESMGR_