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

This commit is contained in:
2016-07-24 14:04:10 +00:00
parent 054a598eb7
commit 0b8b417c6d
3 changed files with 14 additions and 1 deletions

View File

@@ -31,7 +31,7 @@ public:
int main (int argc, char * argv[]) { int main (int argc, char * argv[]) {
VC<30, double> x(1.5), y(3.3); VC<30, double> x(1.5), y(3.3);
double r; double r = 0.0;
PITimeMeasurer tm; PITimeMeasurer tm;
for (int i=0; i<10000; i++) for (int i=0; i<10000; i++)
r = x.dot(y); r = x.dot(y);

View File

@@ -271,6 +271,16 @@ const char * PIString::dataAscii() const {
} }
PIByteArray PIString::toUTF8() const {
buildData(
#ifdef PIP_ICU
"UTF-8"
#endif
);
return data_.resized(data_.size_s() - 1);
}
PIString & PIString::operator +=(const char * str) { PIString & PIString::operator +=(const char * str) {
int l = 0; int l = 0;
while (str[l] != '\0') ++l; while (str[l] != '\0') ++l;

View File

@@ -502,6 +502,9 @@ public:
//! \brief Return \a PIByteArray contains \a data() of this string without terminating null-char //! \brief Return \a PIByteArray contains \a data() of this string without terminating null-char
PIByteArray toByteArray() const {buildData(); return data_.resized(data_.size_s() - 1);} PIByteArray toByteArray() const {buildData(); return data_.resized(data_.size_s() - 1);}
//! \brief Return \a PIByteArray contains UTF-8 \a data() of this string without terminating null-char
PIByteArray toUTF8() const;
/*! \brief Split string with delimiter "delim" to \a PIStringList and return it /*! \brief Split string with delimiter "delim" to \a PIStringList and return it
* \details Example: \snippet pistring.cpp PIString::split */ * \details Example: \snippet pistring.cpp PIString::split */
PIStringList split(const PIString & delim) const; PIStringList split(const PIString & delim) const;