From 271f211fbc3fb476b9b9e42bef5d451564d6ce92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B5=D0=BB=D0=B8=D0=BF=D0=B5=D0=BD=D0=BA=D0=BE=20?= =?UTF-8?q?=D0=98=D0=B2=D0=B0=D0=BD?= Date: Tue, 25 Sep 2018 21:09:32 +0000 Subject: [PATCH] git-svn-id: svn://db.shs.com.ru/pip@630 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5 --- main.cpp | 10 ++++++++-- src_main/core/pistring.h | 8 ++++++++ src_main/piversion.h | 2 +- src_main/system/pisystemmonitor.cpp | 2 +- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index c799659d..fe580593 100644 --- a/main.cpp +++ b/main.cpp @@ -41,10 +41,16 @@ public: } }; int main() { - A a; + /*A a; CONNECTU(PICout::Notifier::object(), finished, &a, pcf); PIString buffer = "my buff:"; - PICout(&buffer, 1) << "int 10 ->" << 10 << ", time ->" << PITime::current(); + PICout(&buffer, 1) << "int 10 ->" << 10 << ", time ->" << PITime::current();*/ + PIString s("str"); + piCout << s; + piCout << s.quoted(); + piCout << s.quoted(); + piCout << s.quote(); + piCout << s; return 0; /*} diff --git a/src_main/core/pistring.h b/src_main/core/pistring.h index b1762327..cd868130 100755 --- a/src_main/core/pistring.h +++ b/src_main/core/pistring.h @@ -343,6 +343,14 @@ public: * \details Example: \snippet pistring.cpp PIString::expandLeftTo * \sa \a expandRightTo() */ PIString & expandLeftTo(const int len, const PIChar & c) {if (len > length()) insert(0, PIString(len - length(), c)); return *this;} + + /*! \brief Add " symbols at the beginning and end of the string, and return this string + * \sa \a quoted() */ + PIString & quote() {insert(0, PIChar('"')); *this += PIChar('"'); return *this;} + + /*! \brief Return quoted copy of this string + * \sa \a quote() */ + PIString quoted() {return PIString(*this).quote();} /*! \brief Reverse string and return this string * \details Example: \snippet pistring.cpp PIString::reverse diff --git a/src_main/piversion.h b/src_main/piversion.h index 97951638..36c3f128 100644 --- a/src_main/piversion.h +++ b/src_main/piversion.h @@ -4,7 +4,7 @@ #define PIP_VERSION_MAJOR 1 #define PIP_VERSION_MINOR 7 -#define PIP_VERSION_REVISION 1 +#define PIP_VERSION_REVISION 2 #define PIP_VERSION_SUFFIX "" #endif // PIVERSION_H diff --git a/src_main/system/pisystemmonitor.cpp b/src_main/system/pisystemmonitor.cpp index a2e12e71..8a1201ca 100755 --- a/src_main/system/pisystemmonitor.cpp +++ b/src_main/system/pisystemmonitor.cpp @@ -326,7 +326,7 @@ void PISystemMonitor::gatherThread(llong id) { ts.id = id; ts.name = tbid.value(id, ""); #ifndef WINDOWS - PIFile f(PRIVATE->proc_dir + "task/" + PIString(id) + "/stat"); + PIFile f(PRIVATE->proc_dir + "task/" + PIString::fromNumber(id) + "/stat"); //piCout << f.path(); if (!f.open(PIIODevice::ReadOnly)) return;