aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llcommon/llstring.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:11 -0500
committerJacek Antonelli2008-08-15 23:45:11 -0500
commit215f423cbe18fe9ca14a26caef918d303bad28ff (patch)
tree0743442b286216cc8e19aa487c26f4e9345ffd64 /linden/indra/llcommon/llstring.cpp
parentSecond Life viewer sources 1.18.3.5-RC (diff)
downloadmeta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.zip
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.gz
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.bz2
meta-impy-215f423cbe18fe9ca14a26caef918d303bad28ff.tar.xz
Second Life viewer sources 1.18.4.0-RC
Diffstat (limited to 'linden/indra/llcommon/llstring.cpp')
-rw-r--r--linden/indra/llcommon/llstring.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/linden/indra/llcommon/llstring.cpp b/linden/indra/llcommon/llstring.cpp
index b5e307f..6dab598 100644
--- a/linden/indra/llcommon/llstring.cpp
+++ b/linden/indra/llcommon/llstring.cpp
@@ -2,6 +2,8 @@
2 * @file llstring.cpp 2 * @file llstring.cpp
3 * @brief String utility functions and the LLString class. 3 * @brief String utility functions and the LLString class.
4 * 4 *
5 * $LicenseInfo:firstyear=2001&license=viewergpl$
6 *
5 * Copyright (c) 2001-2007, Linden Research, Inc. 7 * Copyright (c) 2001-2007, Linden Research, Inc.
6 * 8 *
7 * Second Life Viewer Source Code 9 * Second Life Viewer Source Code
@@ -24,6 +26,7 @@
24 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 26 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
25 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
26 * COMPLETENESS OR PERFORMANCE. 28 * COMPLETENESS OR PERFORMANCE.
29 * $/LicenseInfo$
27 */ 30 */
28 31
29#include "linden_common.h" 32#include "linden_common.h"
@@ -55,6 +58,26 @@ U8 hex_as_nybble(char hex)
55} 58}
56 59
57 60
61bool _read_file_into_string(std::string& str, const char* filename)
62{
63 llifstream ifs(filename, llifstream::binary);
64 if (!ifs.is_open())
65 {
66 llinfos << "Unable to open file" << filename << llendl;
67 return false;
68 }
69
70 std::ostringstream oss;
71
72 oss << ifs.rdbuf();
73 str = oss.str();
74 ifs.close();
75 return true;
76}
77
78
79
80
58// See http://www.unicode.org/Public/BETA/CVTUTF-1-2/ConvertUTF.c 81// See http://www.unicode.org/Public/BETA/CVTUTF-1-2/ConvertUTF.c
59// for the Unicode implementation - this doesn't match because it was written before finding 82// for the Unicode implementation - this doesn't match because it was written before finding
60// it. 83// it.