Loading...
Searching...
No Matches
path.h
Go to the documentation of this file.
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine" and the "irrXML" project.
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __IRR_PATH_H_INCLUDED__
#define __IRR_PATH_H_INCLUDED__
#include "irrString.h"
namespace irr
{
namespace io
{
typedef core::string<fschar_t> path;
struct SNamedPath
{
SNamedPath() {}
SNamedPath(const path& p) : Path(p), InternalName( PathToName(p) )
{
}
bool operator <(const SNamedPath& other) const
{
return InternalName < other.InternalName;
}
void setPath(const path& p)
{
Path = p;
InternalName = PathToName(p);
}
const path& getPath() const
{
return Path;
};
const path& getInternalName() const
{
return InternalName;
}
operator core::stringc() const
{
return core::stringc(getPath());
}
operator core::stringw() const
{
return core::stringw(getPath());
}
protected:
// convert the given path string to a name string.
path PathToName(const path& p) const
{
path name(p);
name.replace( '\\', '/' );
name.make_lower();
return name;
}
private:
path Path;
path InternalName;
};
} // io
} // irr
#endif // __IRR_PATH_H_INCLUDED__
irr::core::string
Definition irrString.h:74
irr::core::string::replace
string< T, TAlloc > & replace(T toReplace, T replaceWith)
Replaces all characters of a special type with another one.
Definition irrString.h:1007
irr::core::string::make_lower
string< T, TAlloc > & make_lower()
Makes the string lower case.
Definition irrString.h:502
irrString.h
irr::core::stringc
string< c8 > stringc
Typedef for character strings.
Definition irrString.h:1358
irr::core::stringw
string< wchar_t > stringw
Typedef for wide character strings.
Definition irrString.h:1361
irr::io
This namespace provides interfaces for input/output: Reading and writing files, accessing zip archive...
Definition EAttributes.h:11
irr::io::path
core::string< fschar_t > path
Type used for all file system related strings.
Definition path.h:17
irr
Everything in the Irrlicht Engine can be found in this namespace.
Definition aabbox3d.h:13
irr::io::SNamedPath::getInternalName
const path & getInternalName() const
Definition path.h:54
irr::io::SNamedPath::setPath
void setPath(const path &p)
Set the path.
Definition path.h:40
irr::io::SNamedPath::SNamedPath
SNamedPath()
Constructor.
Definition path.h:26
irr::io::SNamedPath::PathToName
path PathToName(const path &p) const
Definition path.h:72
irr::io::SNamedPath::getPath
const path & getPath() const
Get the path.
Definition path.h:47
irr::io::SNamedPath::SNamedPath
SNamedPath(const path &p)
Constructor.
Definition path.h:29
irr::io::SNamedPath::operator<
bool operator<(const SNamedPath &other) const
Is smaller comparator.
Definition path.h:34
- Irrlicht Engine Documentation © 2003-2012 by Nikolaus Gebhardt. Generated on for Irrlicht 3D Engine by Doxygen 1.15.0