PageRenderTime 9ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/llcommon/llformat.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 43 lines | 5 code | 5 blank | 33 comment | 0 complexity | 130c2a43eeed9cd5727403f7da35e69b MD5 | raw file
 1/** 
 2 * @file llformat.h
 3 * @date   January 2007
 4 * @brief string formatting utility
 5 *
 6 * $LicenseInfo:firstyear=2007&license=viewerlgpl$
 7 * Second Life Viewer Source Code
 8 * Copyright (C) 2010, Linden Research, Inc.
 9 * 
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation;
13 * version 2.1 of the License only.
14 * 
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 * Lesser General Public License for more details.
19 * 
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
23 * 
24 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
25 * $/LicenseInfo$
26 */
27
28#ifndef LL_LLFORMAT_H
29#define LL_LLFORMAT_H
30
31// Use as follows:
32// llinfos << llformat("Test:%d (%.2f %.2f)", idx, x, y) << llendl;
33//
34// *NOTE: buffer limited to 1024, (but vsnprintf prevents overrun)
35// should perhaps be replaced with boost::format.
36
37std::string LL_COMMON_API llformat(const char *fmt, ...);
38
39// the same version as above but ensures that returned string is in utf8 on windows
40// to enable correct converting utf8_to_wstring.
41std::string LL_COMMON_API llformat_to_utf8(const char *fmt, ...);
42
43#endif // LL_LLFORMAT_H