15.10.2012 - version 0.2.0 - PIIODevice - base of file, ethernet, serial and packets extractor. PIEthernet now support also TCP (client and server). PIConsole now can align labels in each column individually.
This commit is contained in:
6
pivariable.cpp
Normal file → Executable file
6
pivariable.cpp
Normal file → Executable file
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Variable, Struct (simple serialization)
|
||||
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
|
||||
Copyright (C) 2012 Ivan Pelipenko peri4ko@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -40,6 +40,7 @@ bool PIVariant::operator ==(const PIVariant & v) const {
|
||||
case PIVariant::String: return vString == v.vString;
|
||||
case PIVariant::StringList: return vStringList == v.vStringList;
|
||||
};
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -84,6 +85,7 @@ PIString PIVariant::stringValue() const {
|
||||
case PIVariant::String: return vString;
|
||||
case PIVariant::StringList: return vStringList.join("%|%");
|
||||
};
|
||||
return vString;
|
||||
}
|
||||
|
||||
|
||||
@@ -214,7 +216,7 @@ void PIVariable::writeVariable(char * dest) {
|
||||
|
||||
|
||||
void PIStruct::parseFile(const PIString & file) {
|
||||
PIConfig conf(file, PIFile::Read);
|
||||
PIConfig conf(file, PIIODevice::ReadOnly);
|
||||
PIVariable var;
|
||||
PIString ts;
|
||||
uint sz = 0;
|
||||
|
||||
Reference in New Issue
Block a user