8 m_sAbsolutePath = sAbsPath;
15 m_sAbsolutePath = sAbsPath;
21 PL_ASSERT_DEBUG(!sAbsPath.EndsWith_NoCase(
"/"),
"");
22 m_sAbsolutePath = std::move(sAbsPath);
28 return m_sAbsolutePath;
31inline bool plDataDirPath::operator==(
plStringView rhs)
const
33 return m_sAbsolutePath == rhs;
36inline bool plDataDirPath::operator!=(
plStringView rhs)
const
38 return m_sAbsolutePath != rhs;
43 return m_uiDataDirParent != 0;
48 m_sAbsolutePath.
Clear();
49 m_uiDataDirParent = 0;
50 m_uiDataDirLength = 0;
56 return m_sAbsolutePath;
61 PL_ASSERT_DEBUG(
IsValid(),
"Path is not in a data directory, only GetAbsolutePath is allowed to be called.");
62 const plUInt32 uiOffset = m_uiDataDirParent + 1;
68 PL_ASSERT_DEBUG(
IsValid(),
"Path is not in a data directory, only GetAbsolutePath is allowed to be called.");
75 PL_ASSERT_DEBUG(
IsValid(),
"Path is not in a data directory, only GetAbsolutePath is allowed to be called.");
81 PL_ASSERT_DEBUG(
IsValid(),
"Path is not in a data directory, only GetAbsolutePath is allowed to be called.");
82 return m_uiDataDirIndex;
87 inout_stream << m_sAbsolutePath;
88 inout_stream << m_uiDataDirParent;
89 inout_stream << m_uiDataDirLength;
90 inout_stream << m_uiDataDirIndex;
96 inout_stream >> m_sAbsolutePath;
97 inout_stream >> m_uiDataDirParent;
98 inout_stream >> m_uiDataDirLength;
99 inout_stream >> m_uiDataDirIndex;
121 return value.Write(inout_stream);
126 return out_value.Read(inout_stream);
This class encapsulates an array and it's size. It is recommended to use this class instead of plain ...
Definition ArrayPtr.h:37
A reference to a file or folder inside a data directory.
Definition DataDirPath.h:18
void Clear()
Same as the default constructor. Creates an empty, invalid path.
Definition DataDirPath_inl.h:46
plStringView GetDataDirParentRelativePath() const
Returns a relative path including the data directory the path belongs to, e.g. "Testing Chambers/Obje...
Definition DataDirPath_inl.h:59
bool UpdateDataDirInfos(plArrayPtr< plString > dataDirRoots, plUInt32 uiLastKnownDataDirIndex=0) const
If a plDataDirPath is de-serialized, it might not be correct anymore and its data directory reference...
Definition DataDirPath.cpp:5
plStringView GetDataDirRelativePath() const
Returns a path relative to the data directory the path belongs to, e.g. "Objects/Barrel....
Definition DataDirPath_inl.h:66
bool IsValid() const
Returns whether this path is inside a data directory. If not, none of the Get* functions except for G...
Definition DataDirPath_inl.h:41
plDataDirPath()
Default ctor, creates an invalid data directory path.
plUInt8 GetDataDirIndex() const
Returns the index of the data directory the path belongs to.
Definition DataDirPath_inl.h:79
plStringView GetDataDir() const
Returns absolute path to the data directory this path belongs to, e.g. "C:/plEngine/Data/Samples/Test...
Definition DataDirPath_inl.h:73
const plString & GetAbsolutePath() const
Returns the same path this instance was created with. Calling this function is always valid.
Definition DataDirPath_inl.h:54
Interface for binary in (read) streams.
Definition Stream.h:22
Interface for binary out (write) streams.
Definition Stream.h:107
plStringBuilder is a class that is meant for creating and modifying strings.
Definition StringBuilder.h:35
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
bool EndsWith_NoCase(plStringView sEndsWith) const
Returns true, if this string ends with the given string. Case insensitive.
Definition StringView_inl.h:115
plInt32 Compare_NoCase(plStringView sOther) const
Compares this string with the other one. Returns 0 for equality, -1 if this string is 'smaller',...
Definition StringView.cpp:41
plInt32 Compare(plStringView sOther) const
Compares this string with the other one. Returns 0 for equality, -1 if this string is 'smaller',...
Definition StringView.cpp:31
bool IsEqual(plStringView sOther) const
Compares this string view with the other string view for equality.
Definition StringView_inl.h:90
constexpr PL_ALWAYS_INLINE T Min(T f1, T f2)
Returns the smaller value, f1 or f2.
Definition Math_inl.h:27
const char * GetData() const
Returns a pointer to the internal Utf8 string.
Definition String_inl.h:56
plUInt32 GetElementCount() const
Returns the amount of bytes that this string takes (excluding the '\0' terminator).
Definition String_inl.h:65
void Clear()
Resets this string to an empty string.
Definition String_inl.h:49
bool EndsWith_NoCase(plStringView sEndsWith) const
Returns true, if this string ends with the given string. Case insensitive.
Definition StringBase_inl.h:49