PIIODevice fullPathPrefix returns PIConstChars

This commit is contained in:
2022-05-04 16:33:05 +03:00
parent 28ce6e8f3f
commit 6995c25613
4 changed files with 36 additions and 16 deletions

View File

@@ -23,10 +23,7 @@
//! \addtogroup Core
//! \{
//! \~\class PIConstChars piconstchars.h
//! \~\brief
//! \~english C-String class
//! \~russian Класс C-строки
//!
//! \~\details
//! \~english \section PICout_sec0 Synopsis
//! \~russian \section PICout_sec0 Краткий обзор
//! \~english
@@ -54,12 +51,24 @@ bool PIConstChars::startsWith(const PIConstChars & str) const {
}
bool PIConstChars::startsWith(const char c) const {
if (size() < 1) return false;
return str[0] == c;
}
bool PIConstChars::endsWith(const PIConstChars & str) const {
if (size() < str.size()) return false;
return str == right(str.size());
}
bool PIConstChars::endsWith(const char c) const {
if (size() < 1) return false;
return str[len - 1] == c;
}
PIConstChars PIConstChars::mid(const int start, const int len) const {
int s = start, l = len;
if (l == 0 || s >= (int)size() || isEmpty()) return PIConstChars("");