diff options
author | Aaron Brashears <aaronb@lindenlab.com> | 2007-10-04 16:31:48 +0000 |
---|---|---|
committer | Aaron Brashears <aaronb@lindenlab.com> | 2007-10-04 16:31:48 +0000 |
commit | 4942a7b77917f9a163453ecdd040993965672cc0 (patch) | |
tree | 3dd01f5e182d2eea2e34528cebe749d948a477fc /indra/llcommon/llstring.cpp | |
parent | 9fc7049151a16e3722c6ce90899e3c7b63161615 (diff) |
Result of svn merge -r70873:71086 svn+ssh://svn/svn/linden/branches/enable-exceptions into release.
Diffstat (limited to 'indra/llcommon/llstring.cpp')
-rw-r--r-- | indra/llcommon/llstring.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index 0b799b94ae..2d7c903341 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -35,6 +35,26 @@ U8 hex_as_nybble(char hex) } +bool _read_file_into_string(std::string& str, const char* filename) +{ + llifstream ifs(filename, llifstream::binary); + if (!ifs.is_open()) + { + llinfos << "Unable to open file" << filename << llendl; + return false; + } + + std::ostringstream oss; + + oss << ifs.rdbuf(); + str = oss.str(); + ifs.close(); + return true; +} + + + + // See http://www.unicode.org/Public/BETA/CVTUTF-1-2/ConvertUTF.c // for the Unicode implementation - this doesn't match because it was written before finding // it. |