commit request

git-svn-id: svn://db.shs.com.ru/pip@537 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
2017-08-30 09:52:50 +00:00
parent 5a6ae6855e
commit 9c68588447
5 changed files with 36 additions and 36 deletions

View File

@@ -31,7 +31,7 @@ PIString PICodeParser::Macro::expand(PIString args_, bool * ok) const {
}
PIString ca;
if (bi >= 0 && bi < ci) {
ca = args_.left(args_.takeLeft(bi));
ca = args_.left(args_.takeLeft(bi).toInt());
ci -= ca.size_s(); bi -= ca.size_s();
ca += "(" + args_.takeRange("(", ")") + ")";
} else {
@@ -311,7 +311,7 @@ bool PICodeParser::parseFileContent(PIString & fc, bool main) {
str = pfc.takeLeft(sci + 1);
} else {
str = pfc.takeLeft(obi);
pfc.cutLeft(pfc.takeRange("{", "}"));
pfc.cutLeft(pfc.takeRange("{", "}").toInt());
}
parseMember(&root_, str);
}

View File

@@ -307,7 +307,7 @@ PIString PIByteArray::toHex() const {
}
PIByteArray PIByteArray::fromString(PIString str) {
PIByteArray PIByteArray::fromUserInput(PIString str) {
PIByteArray ret;
if (str.trim().isEmpty()) return ret;
str.replaceAll("\n", " ").replaceAll("\t", " ").replaceAll(" ", " ");

View File

@@ -122,7 +122,7 @@ public:
void operator =(const PIDeque<uchar> & d) {resize(d.size()); memcpy(data(), d.data(), d.size());}
static PIByteArray fromString(PIString str);
static PIByteArray fromUserInput(PIString str);
static PIByteArray fromHex(PIString str);
static PIByteArray fromBase64(const PIByteArray & base64);
static PIByteArray fromBase64(const PIString & base64);

View File

@@ -42,7 +42,7 @@ public:
PIString & operator +=(const PIChar & c) {push_back(c); return *this;}
PIString & operator +=(const char * str);
PIString & operator +=(const wchar_t * str);
PIString & operator +=(const PIByteArray & ba) {appendFromChars((const char * )ba.data(), ba.size_s()); return *this;}
// PIString & operator +=(const PIByteArray & ba) {appendFromChars((const char * )ba.data(), ba.size_s()); return *this;}
PIString & operator +=(const PIString & str);
//PIString(const char c) {*this += c;}
@@ -82,16 +82,16 @@ public:
PIString(const int len, const PIChar & c): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; for (int i = 0; i < len; ++i) push_back(c);}
PIString(const short & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
PIString(const ushort & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
PIString(const int & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
PIString(const uint & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
PIString(const long & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
PIString(const ulong & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
PIString(const llong & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
PIString(const ullong & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
PIString(const float & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
PIString(const double & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
// PIString(const short & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
// PIString(const ushort & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
// PIString(const int & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
// PIString(const uint & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
// PIString(const long & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
// PIString(const ulong & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
// PIString(const llong & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
// PIString(const ullong & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
// PIString(const float & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
// PIString(const double & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
//~PIString() {piMonitor.strings--; piMonitor.containers++;}
@@ -173,23 +173,23 @@ public:
bool operator >=(const char * str) const {return *this >= PIString(str);}
operator bool() const {return toBool();}
operator short() const {return toShort();}
operator ushort() const {return toUShort();}
operator int() const {return toInt();}
operator uint() const {return toUInt();}
operator long() const {return toLong();}
operator ulong() const {return toULong();}
operator llong() const {return toLLong();}
operator ullong() const {return toULLong();}
operator float() const {return toFloat();}
operator double() const {return toDouble();}
// operator bool() const {return toBool();}
// operator short() const {return toShort();}
// operator ushort() const {return toUShort();}
// operator int() const {return toInt();}
// operator uint() const {return toUInt();}
// operator long() const {return toLong();}
// operator ulong() const {return toULong();}
// operator llong() const {return toLLong();}
// operator ullong() const {return toULLong();}
// operator float() const {return toFloat();}
// operator double() const {return toDouble();}
/*! \brief Append string "str" at the end of string
* \details Example: \snippet pistring.cpp PIString::<<(PIString) */
PIString & operator <<(const PIString & str) {*this += str; return *this;}
//inline PIString & operator <<(const char c) {*this += c; return *this;}
// inline PIString & operator <<(const char c) {*this += c; return *this;}
/*! \brief Append symbol "c" at the end of string
* \details Example: \snippet pistring.cpp PIString::<<(PIChar) */
@@ -800,13 +800,13 @@ public:
PIStringList & operator <<(const PIString & str) {push_back(str); return *this;}
PIStringList & operator <<(const PIStringList & sl) {piForeachC (PIString & i, sl) push_back(i); return *this;}
//inline PIStringList & operator <<(const char c) {push_back(PIString(c)); return *this;}
// inline PIStringList & operator <<(const char c) {push_back(PIString(c)); return *this;}
PIStringList & operator <<(const char * str) {push_back(PIString(str)); return *this;}
PIStringList & operator <<(const int & num) {push_back(PIString::fromNumber(num)); return *this;}
PIStringList & operator <<(const short & num) {push_back(PIString::fromNumber(num)); return *this;}
PIStringList & operator <<(const long & num) {push_back(PIString::fromNumber(num)); return *this;}
PIStringList & operator <<(const float & num) {push_back(PIString::fromNumber(num)); return *this;}
PIStringList & operator <<(const double & num) {push_back(PIString::fromNumber(num)); return *this;}
// PIStringList & operator <<(const int & num) {push_back(PIString::fromNumber(num)); return *this;}
// PIStringList & operator <<(const short & num) {push_back(PIString::fromNumber(num)); return *this;}
// PIStringList & operator <<(const long & num) {push_back(PIString::fromNumber(num)); return *this;}
// PIStringList & operator <<(const float & num) {push_back(PIString::fromNumber(num)); return *this;}
// PIStringList & operator <<(const double & num) {push_back(PIString::fromNumber(num)); return *this;}
};

View File

@@ -229,8 +229,8 @@ bool PIConnection::configure(PIConfig & conf, const PIString & name_) {
pe->setPayloadSize(e->getValue("payloadSize", pe->payloadSize()));
pe->setPacketSize(e->getValue("packetSize", pe->packetSize()));
pe->setTimeout(e->getValue("timeout", pe->timeout()));
pe->setHeader(PIByteArray::fromString(e->getValue("header", "").value()));
pe->setFooter(PIByteArray::fromString(e->getValue("footer", "").value()));
pe->setHeader(PIByteArray::fromUserInput(e->getValue("header", "").value()));
pe->setFooter(PIByteArray::fromUserInput(e->getValue("footer", "").value()));
}
}
setDebug(pdebug);
@@ -251,7 +251,7 @@ bool PIConnection::configure(PIConfig & conf, const PIString & name_) {
float freq = e->getValue("frequency");
piForeachC (PIString & d, devs)
addSender(e->name(), dev_aliases.value(d, d), freq);
PIByteArray fd(PIByteArray::fromString(e->getValue("fixedData").value()));
PIByteArray fd(PIByteArray::fromUserInput(e->getValue("fixedData").value()));
setSenderFixedData(e->name(), fd);
}
return true;