root/OpenSceneGraph/trunk/src/osgDB/fstream.cpp @ 13041

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

Ran script to remove trailing spaces and tabs

  • Property svn:eol-style set to native
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#include <osgDB/fstream>
15#include <osgDB/ConvertUTF>
16
17#include <osg/Config>
18
19namespace osgDB
20{
21
22#ifdef OSG_USE_UTF8_FILENAME
23#define OSGDB_CONVERT_UTF8_FILENAME(s) convertUTF8toUTF16(s).c_str()
24#else
25#define OSGDB_CONVERT_UTF8_FILENAME(s) s
26#endif
27
28    fstream::fstream(){}
29    fstream::fstream(const char* filename,
30        std::ios_base::openmode mode) : std::fstream(OSGDB_CONVERT_UTF8_FILENAME(filename), mode)
31    {}
32    fstream::~fstream(){}
33    void fstream::open(const char* filename,
34        std::ios_base::openmode mode)
35    {
36        std::fstream::open(OSGDB_CONVERT_UTF8_FILENAME(filename), mode);
37    }
38
39    ifstream::ifstream(){}
40    ifstream::ifstream(const char* filename,
41        std::ios_base::openmode mode) : std::ifstream(OSGDB_CONVERT_UTF8_FILENAME(filename), mode)
42    {}
43    ifstream::~ifstream(){}
44    void ifstream::open(const char* filename,
45        std::ios_base::openmode mode)
46    {
47        std::ifstream::open(OSGDB_CONVERT_UTF8_FILENAME(filename), mode);
48    }
49
50    ofstream::ofstream(){}
51    ofstream::ofstream(const char* filename,
52        std::ios_base::openmode mode) : std::ofstream(OSGDB_CONVERT_UTF8_FILENAME(filename), mode)
53    {}
54    ofstream::~ofstream(){}
55    void ofstream::open(const char* filename,
56        std::ios_base::openmode mode)
57    {
58        std::ofstream::open(OSGDB_CONVERT_UTF8_FILENAME(filename), mode);
59    }
60
61}
Note: See TracBrowser for help on using the browser.