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

This commit is contained in:
2019-06-26 11:08:10 +00:00
parent 4e84f935d2
commit 19d4ab94b9
16 changed files with 61 additions and 94 deletions

View File

@@ -39,6 +39,10 @@ public:
//! Contructs an empty string
PIString(): PIDeque<PIChar>() {}
static const float ElideLeft ;
static const float ElideCenter;
static const float ElideRight ;
//inline PIString & operator +=(const char c) {push_back(c); return *this;}
PIString & operator +=(const PIChar & c) {push_back(c); return *this;}
PIString & operator +=(const char * str);
@@ -354,7 +358,7 @@ public:
PIString quoted(PIChar c = PIChar('"')) {return PIString(*this).quote(c);}
/*! \brief Reverse string and return this string
* \details Example: \snippet pistring.cpp PIString::reverse
* \details Example: \snippet pistring.cpp PIString::reverse
* \sa \a reversed() */
PIString & reverse() {PIString str(*this); clear(); piForeachR (const PIChar & c, str) push_back(c); return *this;}
@@ -362,6 +366,15 @@ public:
* \details Example: \snippet pistring.cpp PIString::reversed
* \sa \a reverse() */
PIString reversed() const {PIString str(*this); str.reverse(); return str;}
/*! \brief Elide string to maximum size \"size\" and return this string
* \sa \a elided() */
PIString & elide(int size, float pos = ElideCenter);
/*! \brief Elide copy of this string to maximum size \"size\" and return it
* \details Example: \snippet pistring.cpp PIString::elided
* \sa \a elide() */
PIString elided(int size, float pos = ElideCenter) const {PIString str(*this); str.elide(size, pos); return str;}
/*! \brief Take a part of string from symbol at index "start" and maximum length "len" and return it