aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llcommon/llfile.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:34 -0500
committerJacek Antonelli2008-08-15 23:45:34 -0500
commitcd17687f01420952712a500107e0f93e7ab8d5f8 (patch)
treece48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/llcommon/llfile.cpp
parentSecond Life viewer sources 1.19.0.5 (diff)
downloadmeta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz
Second Life viewer sources 1.19.1.0
Diffstat (limited to 'linden/indra/llcommon/llfile.cpp')
-rw-r--r--linden/indra/llcommon/llfile.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/linden/indra/llcommon/llfile.cpp b/linden/indra/llcommon/llfile.cpp
index 38157df..6ccf6ac 100644
--- a/linden/indra/llcommon/llfile.cpp
+++ b/linden/indra/llcommon/llfile.cpp
@@ -286,8 +286,36 @@ llofstream::llofstream(const char *_Filename,
286 286
287llofstream::~llofstream() 287llofstream::~llofstream()
288{ // destroy the object 288{ // destroy the object
289 close();
289 delete _Filebuffer; 290 delete _Filebuffer;
290} 291}
291 292
292#endif // #if USE_LLFILESTREAMS 293#endif // #if USE_LLFILESTREAMS
293 294
295/************** helper functions ********************************/
296
297std::streamsize llifstream_size(llifstream& ifstr)
298{
299 if(!ifstr.is_open()) return 0;
300 std::streampos pos_old = ifstr.tellg();
301 ifstr.seekg(0, ios_base::beg);
302 std::streampos pos_beg = ifstr.tellg();
303 ifstr.seekg(0, ios_base::end);
304 std::streampos pos_end = ifstr.tellg();
305 ifstr.seekg(pos_old, ios_base::beg);
306 return pos_end - pos_beg;
307}
308
309std::streamsize llofstream_size(llofstream& ofstr)
310{
311 if(!ofstr.is_open()) return 0;
312 std::streampos pos_old = ofstr.tellp();
313 ofstr.seekp(0, ios_base::beg);
314 std::streampos pos_beg = ofstr.tellp();
315 ofstr.seekp(0, ios_base::end);
316 std::streampos pos_end = ofstr.tellp();
317 ofstr.seekp(pos_old, ios_base::beg);
318 return pos_end - pos_beg;
319}
320
321