OpenIG  2.0.4
cross-platform open-source OpenSceneGraph Image Generator
FileSystem.h
1 //#******************************************************************************
2 //#*
3 //#* Copyright (C) 2015 Compro Computer Services
4 //#* http://openig.compro.net
5 //#*
6 //#* Source available at: https://github.com/CCSI-CSSI/MuseOpenIG
7 //#*
8 //#* This software is released under the LGPL.
9 //#*
10 //#* This software is free software; you can redistribute it and/or modify
11 //#* it under the terms of the GNU Lesser General Public License as published
12 //#* by the Free Software Foundation; either version 2.1 of the License, or
13 //#* (at your option) any later version.
14 //#*
15 //#* This software is distributed in the hope that it will be useful,
16 //#* but WITHOUT ANY WARRANTY; without even the implied warranty of
17 //#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
18 //#* the GNU Lesser General Public License for more details.
19 //#*
20 //#* You should have received a copy of the GNU Lesser General Public License
21 //#* along with this library; if not, write to the Free Software
22 //#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 //#*
24 //#* Please direct any questions or comments to the OpenIG Forums
25 //#* Email address: openig@compro.net
26 //#*
27 //#*
28 //#* Please direct any questions or comments to the OpenIG Forums
29 //#* Email address: openig@compro.net
30 //#*
31 //#*
32 //#*****************************************************************************
33 
34 #pragma once
35 
36 #if defined(OPENIG_SDK)
37  #include <OpenIG-Base/Export.h>
38  #include <OpenIG-Base/StringUtils.h>
39 #else
40  #include <Core-Base/Export.h>
41  #include <Core-Base/StringUtils.h>
42 #endif
43 
44 #include <string>
45 
46 namespace OpenIG {
47  namespace Base {
48 
55  class IGCORE_EXPORT FileSystem
56  {
57  public:
66  static bool fileExists(const std::string& strFileName);
67 
76  static std::string readFileIntoString(const std::string& strFileName);
77 
86  static std::string fileFullPath(const std::string& strFileName);
87 
88  /*\brief Enum for Resource types
89  * \author Trajce Nikolov Nick <openig@compro.net>
90  * \copyright(c)Compro Computer Services, Inc.
91 //#*
92 //#* Please direct any questions or comments to the OpenIG Forums
93 //#* Email address: openig@compro.net
94 //#*
95 //#*
96 //#* Please direct any questions or comments to the OpenIG Forums
97 //#* Email address: openig@compro.net
98 //#*
99  * \date Thu Oct 22 2015
100  */
101  enum PathType
102  {
103  None,
104  Plugins,
105  Data,
106  Resources,
107  PathList // This is in form of {path1;path2;path3}/path/file - should return the first valid path found
108  };
109 
119  static std::string path(PathType type, const std::string& path = "");
120 
129  static bool match(const OpenIG::Base::StringUtils::StringList& patterns, const std::string& simpleFileName);
130 
139  static time_t lastWriteTime(const std::string& fileName);
140  };
141  } // namespace
142 } // namespace
143 
Definition: ImageGenerator.h:62
The FileSystem class.
Definition: FileSystem.h:55