root/OpenSceneGraph/trunk/include/osgDB/fstream @ 13041

Revision 13041, 1.9 kB (checked in by robert, 2 years ago)

Ran script to remove trailing spaces and tabs

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version.  The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 * OpenSceneGraph Public License for more details.
12*/
13
14#ifndef OSGDB_FSTREAM
15#define OSGDB_FSTREAM 1
16
17#include <osgDB/Export>
18#include <osg/Export>
19
20#include <fstream>
21
22namespace osgDB
23{
24
25/**
26* Replacements for std::fstream, std::ifstream, and std::ofstream to
27* automatically handle UTF-8 to UTF-16 filename conversion. Always use one
28* of these classes in any OpenSceneGraph code instead of the STL equivalent.
29*/
30
31class OSGDB_EXPORT fstream : public std::fstream
32{
33public:
34    fstream();
35    explicit fstream(const char* filename,
36        std::ios_base::openmode mode = std::ios_base::in | std::ios_base::out);
37    ~fstream();
38
39    void open(const char* filename,
40        std::ios_base::openmode mode = std::ios_base::in | std::ios_base::out);
41};
42
43class OSGDB_EXPORT ifstream : public std::ifstream
44{
45public:
46    ifstream();
47    explicit ifstream(const char* filename,
48        std::ios_base::openmode mode = std::ios_base::in);
49    ~ifstream();
50
51    void open(const char* filename,
52        std::ios_base::openmode mode = std::ios_base::in);
53};
54
55class OSGDB_EXPORT ofstream : public std::ofstream
56{
57public:
58    ofstream();
59    explicit ofstream(const char* filename,
60        std::ios_base::openmode mode = std::ios_base::out);
61    ~ofstream();
62
63    void open(const char* filename,
64        std::ios_base::openmode mode = std::ios_base::out);
65};
66
67}
68
69#endif
Note: See TracBrowser for help on using the browser.