Nirtcpp 2.1.0
Nirtcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
path.hpp
1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine" and the "irrXML" project.
3// For conditions of distribution and use, see copyright notice in nirtcpp/nirtcpp.hpp
4
5#ifndef NIRT_PATH_HPP_INCLUDED
6#define NIRT_PATH_HPP_INCLUDED
7
8#include <nirtcpp/core/engine/irrString.hpp>
9
10namespace nirt::io
11{
12
14
18
20
24{
25public:
28
30 SNamedPath(const path& p) : Path(p), InternalName( PathToName(p) )
31 {
32 }
33
34public:
36 bool operator <(const SNamedPath& other) const
37 {
38 return InternalName < other.InternalName;
39 }
40
42 void setPath(const path& p)
43 {
44 Path = p;
45 InternalName = PathToName(p);
46 }
47
49 const path& getPath() const
50 {
51 return Path;
52 };
53
56 const path& getInternalName() const
57 {
58 return InternalName;
59 }
60
62 operator core::stringc() const
63 {
64 return core::stringc(getPath());
65 }
67 operator core::stringw() const
68 {
69 return core::stringw(getPath());
70 }
71
72protected:
73 // convert the given path string to a name string.
74 path PathToName(const path& p) const
75 {
76 path name(p);
77 name.replace( '\\', '/' );
78 name.make_lower();
79 return name;
80 }
81
82private:
83 path Path;
84 path InternalName;
85};
86
87} // namespace nirt::io
88
89#endif // NIRT_PATH_HPP_INCLUDED
Axis aligned bounding box in 3d dimensional space.
Definition aabbox3d.hpp:22
Used in places where we identify objects by a filename, but don't actually work with the real filenam...
Definition path.hpp:24
SNamedPath()
Constructor.
Definition path.hpp:27
void setPath(const path &p)
Set the path.
Definition path.hpp:42
const path & getInternalName() const
Definition path.hpp:56
const path & getPath() const
Get the path.
Definition path.hpp:49
bool operator<(const SNamedPath &other) const
Is smaller comparator.
Definition path.hpp:36
SNamedPath(const path &p)
Constructor.
Definition path.hpp:30
string< wchar_t > stringw
using type alias for wide character strings
Definition irrString.hpp:1460
string< c8 > stringc
using type alias for character strings
Definition irrString.hpp:1457
This namespace provides interfaces for input/output: Reading and writing files, accessing zip archive...
Definition path.hpp:11
core::string< fschar_t > path
Type used for all file system related strings.
Definition path.hpp:17

Nirtcpp    @cppfx.xyz

Esvcpp    esv::print