git-svn-id: svn://db.shs.com.ru/pip@208 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2016-07-24 19:34:37 +00:00
parent 314c4a1a9b
commit 8befd35fd6
4 changed files with 23 additions and 9 deletions

View File

@@ -193,6 +193,19 @@ PIString PIString::fromAscii(const char * s) {
}
PIString PIString::fromCodepage(const char * s, const char * c) {
int l = 0;
while (s[l] != '\0') ++l;
PIString ret;
if (l > 0) ret.appendFromChars(s, l
#ifdef PIP_ICU
, c
#endif
);
return ret;
}
void PIString::buildData(const char * cp) const {
data_.clear();
#ifdef PIP_ICU

View File

@@ -731,7 +731,10 @@ public:
//! \brief Return string constructed from ASCII
static PIString fromAscii(const char * s);
//! \brief Return string constructed from "c" codepage
static PIString fromCodepage(const char * s, const char * c);
//! \brief Return string contains human readable size in B/kB/MB/GB/TB
//! \details Example: \snippet pistring.cpp PIString::readableSize
static PIString readableSize(llong bytes) {PIString s; s.setReadableSize(bytes); return s;}