From 4942a7b77917f9a163453ecdd040993965672cc0 Mon Sep 17 00:00:00 2001 From: Aaron Brashears Date: Thu, 4 Oct 2007 16:31:48 +0000 Subject: Result of svn merge -r70873:71086 svn+ssh://svn/svn/linden/branches/enable-exceptions into release. --- indra/llcommon/llstring.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'indra/llcommon/llstring.cpp') 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. -- cgit v1.2.3