OGLplus (0.52.0) a C++ wrapper for OpenGL

resources.hpp
Go to the documentation of this file.
1 
12 #pragma once
13 #ifndef OGLPLUS_OPT_RESOURCES_1107121519_HPP
14 #define OGLPLUS_OPT_RESOURCES_1107121519_HPP
15 
16 #include <oglplus/config/basic.hpp>
18 #include <oglplus/utils/filesystem.hpp>
19 
20 # include <fstream>
21 
22 namespace oglplus {
23 namespace aux {
24 
25 std::size_t FindResourceFile(
26  std::ifstream& file,
27  const std::string& path,
28  const char** exts,
29  std::size_t nexts
30 );
31 
32 } // namespace aux
33 
34 std::size_t FindResourceFile(
35  std::ifstream& file,
36  const std::string& category,
37  const std::string& name,
38  const char** exts,
39  unsigned nexts
40 );
41 
42 inline bool OpenResourceFile(
43  std::ifstream& file,
44  const std::string& category,
45  const std::string& name,
46  const char* ext
47 )
48 {
49  return FindResourceFile(
50  file,
51  category,
52  name,
53  &ext,
54  1
55  ) == 0;
56 }
57 
58 class ResourceFile
59  : public std::ifstream
60 {
61 public:
62  std::ifstream& stream(void) { return *this; }
63 
64  ResourceFile(
65  const std::string& category,
66  const std::string& name,
67  const char* ext
68  );
69 };
70 
71 } // namespace oglplus
72 
73 #if !OGLPLUS_LINK_LIBRARY || defined(OGLPLUS_IMPLEMENTING_LIBRARY)
74 # include <oglplus/opt/resources.ipp>
75 #endif
76 
77 #endif // include guard
Application/startup options-related declarations unrelated to OpenGL.

Copyright © 2010-2014 Matúš Chochlík, University of Žilina, Žilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Mon Sep 22 2014 by Doxygen (version 1.8.6).