|
@@ -35,24 +35,21 @@ namespace isc {
|
|
namespace data {
|
|
namespace data {
|
|
|
|
|
|
std::string
|
|
std::string
|
|
-Element::str()
|
|
|
|
-{
|
|
|
|
|
|
+Element::str() {
|
|
std::stringstream ss;
|
|
std::stringstream ss;
|
|
toJSON(ss);
|
|
toJSON(ss);
|
|
- return ss.str();
|
|
|
|
|
|
+ return (ss.str());
|
|
}
|
|
}
|
|
|
|
|
|
std::string
|
|
std::string
|
|
-Element::toWire()
|
|
|
|
-{
|
|
|
|
|
|
+Element::toWire() {
|
|
std::stringstream ss;
|
|
std::stringstream ss;
|
|
toJSON(ss);
|
|
toJSON(ss);
|
|
- return ss.str();
|
|
|
|
|
|
+ return (ss.str());
|
|
}
|
|
}
|
|
|
|
|
|
void
|
|
void
|
|
-Element::toWire(std::ostream& ss)
|
|
|
|
-{
|
|
|
|
|
|
+Element::toWire(std::ostream& ss) {
|
|
toJSON(ss);
|
|
toJSON(ss);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -65,63 +62,62 @@ Element::toWire(std::ostream& ss)
|
|
//
|
|
//
|
|
bool
|
|
bool
|
|
Element::getValue(long int& t UNUSED_PARAM) {
|
|
Element::getValue(long int& t UNUSED_PARAM) {
|
|
- return false;
|
|
|
|
|
|
+ return (false);
|
|
}
|
|
}
|
|
|
|
|
|
bool
|
|
bool
|
|
Element::getValue(double& t UNUSED_PARAM) {
|
|
Element::getValue(double& t UNUSED_PARAM) {
|
|
- return false;
|
|
|
|
|
|
+ return (false);
|
|
}
|
|
}
|
|
|
|
|
|
bool
|
|
bool
|
|
Element::getValue(bool& t UNUSED_PARAM) {
|
|
Element::getValue(bool& t UNUSED_PARAM) {
|
|
- return false;
|
|
|
|
|
|
+ return (false);
|
|
}
|
|
}
|
|
|
|
|
|
bool
|
|
bool
|
|
Element::getValue(std::string& t UNUSED_PARAM) {
|
|
Element::getValue(std::string& t UNUSED_PARAM) {
|
|
- return false;
|
|
|
|
|
|
+ return (false);
|
|
}
|
|
}
|
|
|
|
|
|
bool
|
|
bool
|
|
Element::getValue(std::vector<ElementPtr>& t UNUSED_PARAM) {
|
|
Element::getValue(std::vector<ElementPtr>& t UNUSED_PARAM) {
|
|
- return false;
|
|
|
|
|
|
+ return (false);
|
|
}
|
|
}
|
|
|
|
|
|
bool
|
|
bool
|
|
Element::getValue(std::map<std::string, ElementPtr>& t UNUSED_PARAM) {
|
|
Element::getValue(std::map<std::string, ElementPtr>& t UNUSED_PARAM) {
|
|
- return false;
|
|
|
|
|
|
+ return (false);
|
|
}
|
|
}
|
|
|
|
|
|
bool
|
|
bool
|
|
Element::setValue(const long int v UNUSED_PARAM) {
|
|
Element::setValue(const long int v UNUSED_PARAM) {
|
|
- return false;
|
|
|
|
|
|
+ return (false);
|
|
}
|
|
}
|
|
|
|
|
|
bool
|
|
bool
|
|
Element::setValue(const double v UNUSED_PARAM) {
|
|
Element::setValue(const double v UNUSED_PARAM) {
|
|
- return false;
|
|
|
|
|
|
+ return (false);
|
|
}
|
|
}
|
|
|
|
|
|
bool
|
|
bool
|
|
Element::setValue(const bool t UNUSED_PARAM) {
|
|
Element::setValue(const bool t UNUSED_PARAM) {
|
|
- return false;
|
|
|
|
|
|
+ return (false);
|
|
}
|
|
}
|
|
|
|
|
|
bool
|
|
bool
|
|
Element::setValue(const std::string& v UNUSED_PARAM) {
|
|
Element::setValue(const std::string& v UNUSED_PARAM) {
|
|
- return false;
|
|
|
|
|
|
+ return (false);
|
|
}
|
|
}
|
|
|
|
|
|
bool
|
|
bool
|
|
Element::setValue(const std::vector<ElementPtr>& v UNUSED_PARAM) {
|
|
Element::setValue(const std::vector<ElementPtr>& v UNUSED_PARAM) {
|
|
- return false;
|
|
|
|
|
|
+ return (false);
|
|
}
|
|
}
|
|
|
|
|
|
bool
|
|
bool
|
|
-Element::setValue(const std::map<std::string, ElementPtr>& v UNUSED_PARAM)
|
|
|
|
-{
|
|
|
|
- return false;
|
|
|
|
|
|
+Element::setValue(const std::map<std::string, ElementPtr>& v UNUSED_PARAM) {
|
|
|
|
+ return (false);
|
|
}
|
|
}
|
|
|
|
|
|
ElementPtr
|
|
ElementPtr
|
|
@@ -180,7 +176,7 @@ bool
|
|
Element::find(const std::string& identifier UNUSED_PARAM,
|
|
Element::find(const std::string& identifier UNUSED_PARAM,
|
|
ElementPtr& t UNUSED_PARAM)
|
|
ElementPtr& t UNUSED_PARAM)
|
|
{
|
|
{
|
|
- return false;
|
|
|
|
|
|
+ return (false);
|
|
}
|
|
}
|
|
|
|
|
|
namespace {
|
|
namespace {
|
|
@@ -194,11 +190,11 @@ throwJSONError(const std::string& error, const std::string& file, int line, int
|
|
}
|
|
}
|
|
|
|
|
|
std::ostream& operator <<(std::ostream &out, const isc::data::ElementPtr& e) {
|
|
std::ostream& operator <<(std::ostream &out, const isc::data::ElementPtr& e) {
|
|
- return out << e->str();
|
|
|
|
|
|
+ return (out << e->str());
|
|
}
|
|
}
|
|
|
|
|
|
bool operator==(const isc::data::ElementPtr a, const isc::data::ElementPtr b) {
|
|
bool operator==(const isc::data::ElementPtr a, const isc::data::ElementPtr b) {
|
|
- return a->equals(b);
|
|
|
|
|
|
+ return (a->equals(b));
|
|
};
|
|
};
|
|
|
|
|
|
//
|
|
//
|
|
@@ -206,37 +202,37 @@ bool operator==(const isc::data::ElementPtr a, const isc::data::ElementPtr b) {
|
|
//
|
|
//
|
|
ElementPtr
|
|
ElementPtr
|
|
Element::create() {
|
|
Element::create() {
|
|
- return ElementPtr(new NullElement());
|
|
|
|
|
|
+ return (ElementPtr(new NullElement()));
|
|
}
|
|
}
|
|
|
|
|
|
ElementPtr
|
|
ElementPtr
|
|
Element::create(const long int i) {
|
|
Element::create(const long int i) {
|
|
- return ElementPtr(new IntElement(i));
|
|
|
|
|
|
+ return (ElementPtr(new IntElement(i)));
|
|
}
|
|
}
|
|
|
|
|
|
ElementPtr
|
|
ElementPtr
|
|
Element::create(const double d) {
|
|
Element::create(const double d) {
|
|
- return ElementPtr(new DoubleElement(d));
|
|
|
|
|
|
+ return (ElementPtr(new DoubleElement(d)));
|
|
}
|
|
}
|
|
|
|
|
|
ElementPtr
|
|
ElementPtr
|
|
Element::create(const std::string& s) {
|
|
Element::create(const std::string& s) {
|
|
- return ElementPtr(new StringElement(s));
|
|
|
|
|
|
+ return (ElementPtr(new StringElement(s)));
|
|
}
|
|
}
|
|
|
|
|
|
ElementPtr
|
|
ElementPtr
|
|
Element::create(const bool b) {
|
|
Element::create(const bool b) {
|
|
- return ElementPtr(new BoolElement(b));
|
|
|
|
|
|
+ return (ElementPtr(new BoolElement(b)));
|
|
}
|
|
}
|
|
|
|
|
|
ElementPtr
|
|
ElementPtr
|
|
Element::createList() {
|
|
Element::createList() {
|
|
- return ElementPtr(new ListElement());
|
|
|
|
|
|
+ return (ElementPtr(new ListElement()));
|
|
}
|
|
}
|
|
|
|
|
|
ElementPtr
|
|
ElementPtr
|
|
Element::createMap() {
|
|
Element::createMap() {
|
|
- return ElementPtr(new MapElement());
|
|
|
|
|
|
+ return (ElementPtr(new MapElement()));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -248,10 +244,10 @@ bool
|
|
char_in(const char c, const char *chars) {
|
|
char_in(const char c, const char *chars) {
|
|
for (size_t i = 0; i < strlen(chars); ++i) {
|
|
for (size_t i = 0; i < strlen(chars); ++i) {
|
|
if (chars[i] == c) {
|
|
if (chars[i] == c) {
|
|
- return true;
|
|
|
|
|
|
+ return (true);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return false;
|
|
|
|
|
|
+ return (false);
|
|
}
|
|
}
|
|
|
|
|
|
void
|
|
void
|
|
@@ -332,7 +328,7 @@ str_from_stringstream(std::istream &in, const std::string& file, const int line,
|
|
c = in.get();
|
|
c = in.get();
|
|
++pos;
|
|
++pos;
|
|
}
|
|
}
|
|
- return ss.str();
|
|
|
|
|
|
+ return (ss.str());
|
|
}
|
|
}
|
|
|
|
|
|
std::string
|
|
std::string
|
|
@@ -342,7 +338,7 @@ word_from_stringstream(std::istream &in, int& pos) {
|
|
ss << (char) in.get();
|
|
ss << (char) in.get();
|
|
}
|
|
}
|
|
pos += ss.str().size();
|
|
pos += ss.str().size();
|
|
- return ss.str();
|
|
|
|
|
|
+ return (ss.str());
|
|
}
|
|
}
|
|
|
|
|
|
static std::string
|
|
static std::string
|
|
@@ -353,7 +349,7 @@ number_from_stringstream(std::istream &in, int& pos) {
|
|
ss << (char) in.get();
|
|
ss << (char) in.get();
|
|
}
|
|
}
|
|
pos += ss.str().size();
|
|
pos += ss.str().size();
|
|
- return ss.str();
|
|
|
|
|
|
+ return (ss.str());
|
|
}
|
|
}
|
|
|
|
|
|
// Should we change from IntElement and DoubleElement to NumberElement
|
|
// Should we change from IntElement and DoubleElement to NumberElement
|
|
@@ -386,9 +382,9 @@ from_stringstream_number(std::istream &in, int &pos) {
|
|
}
|
|
}
|
|
|
|
|
|
if (is_double) {
|
|
if (is_double) {
|
|
- return Element::create(d);
|
|
|
|
|
|
+ return (Element::create(d));
|
|
} else {
|
|
} else {
|
|
- return Element::create(i);
|
|
|
|
|
|
+ return (Element::create(i));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -398,13 +394,13 @@ from_stringstream_bool(std::istream &in, const std::string& file,
|
|
{
|
|
{
|
|
const std::string word = word_from_stringstream(in, pos);
|
|
const std::string word = word_from_stringstream(in, pos);
|
|
if (boost::iequals(word, "True")) {
|
|
if (boost::iequals(word, "True")) {
|
|
- return Element::create(true);
|
|
|
|
|
|
+ return (Element::create(true));
|
|
} else if (boost::iequals(word, "False")) {
|
|
} else if (boost::iequals(word, "False")) {
|
|
- return Element::create(false);
|
|
|
|
|
|
+ return (Element::create(false));
|
|
} else {
|
|
} else {
|
|
throwJSONError(std::string("Bad boolean value: ") + word, file, line, pos);
|
|
throwJSONError(std::string("Bad boolean value: ") + word, file, line, pos);
|
|
// above is a throw shortcurt, return empty is never reached
|
|
// above is a throw shortcurt, return empty is never reached
|
|
- return ElementPtr();
|
|
|
|
|
|
+ return (ElementPtr());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -414,17 +410,17 @@ from_stringstream_null(std::istream &in, const std::string& file,
|
|
{
|
|
{
|
|
const std::string word = word_from_stringstream(in, pos);
|
|
const std::string word = word_from_stringstream(in, pos);
|
|
if (boost::iequals(word, "null")) {
|
|
if (boost::iequals(word, "null")) {
|
|
- return Element::create();
|
|
|
|
|
|
+ return (Element::create());
|
|
} else {
|
|
} else {
|
|
throwJSONError(std::string("Bad null value: ") + word, file, line, pos);
|
|
throwJSONError(std::string("Bad null value: ") + word, file, line, pos);
|
|
- return ElementPtr();
|
|
|
|
|
|
+ return (ElementPtr());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
ElementPtr
|
|
ElementPtr
|
|
from_stringstream_string(std::istream& in, const std::string& file, int& line, int& pos)
|
|
from_stringstream_string(std::istream& in, const std::string& file, int& line, int& pos)
|
|
{
|
|
{
|
|
- return Element::create(str_from_stringstream(in, file, line, pos));
|
|
|
|
|
|
+ return (Element::create(str_from_stringstream(in, file, line, pos)));
|
|
}
|
|
}
|
|
|
|
|
|
ElementPtr
|
|
ElementPtr
|
|
@@ -444,7 +440,7 @@ from_stringstream_list(std::istream &in, const std::string& file, int& line, int
|
|
c = in.get();
|
|
c = in.get();
|
|
pos++;
|
|
pos++;
|
|
}
|
|
}
|
|
- return list;
|
|
|
|
|
|
+ return (list);
|
|
}
|
|
}
|
|
|
|
|
|
ElementPtr
|
|
ElementPtr
|
|
@@ -474,53 +470,53 @@ from_stringstream_map(std::istream &in, const std::string& file, int& line,
|
|
pos++;
|
|
pos++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return map;
|
|
|
|
|
|
+ return (map);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
std::string
|
|
std::string
|
|
Element::typeToName(Element::types type)
|
|
Element::typeToName(Element::types type)
|
|
{
|
|
{
|
|
- switch(type) {
|
|
|
|
|
|
+ switch (type) {
|
|
case Element::integer:
|
|
case Element::integer:
|
|
- return std::string("integer");
|
|
|
|
|
|
+ return (std::string("integer"));
|
|
case Element::real:
|
|
case Element::real:
|
|
- return std::string("real");
|
|
|
|
|
|
+ return (std::string("real"));
|
|
case Element::boolean:
|
|
case Element::boolean:
|
|
- return std::string("boolean");
|
|
|
|
|
|
+ return (std::string("boolean"));
|
|
case Element::string:
|
|
case Element::string:
|
|
- return std::string("string");
|
|
|
|
|
|
+ return (std::string("string"));
|
|
case Element::list:
|
|
case Element::list:
|
|
- return std::string("list");
|
|
|
|
|
|
+ return (std::string("list"));
|
|
case Element::map:
|
|
case Element::map:
|
|
- return std::string("map");
|
|
|
|
|
|
+ return (std::string("map"));
|
|
case Element::null:
|
|
case Element::null:
|
|
- return std::string("null");
|
|
|
|
|
|
+ return (std::string("null"));
|
|
case Element::any:
|
|
case Element::any:
|
|
- return std::string("any");
|
|
|
|
|
|
+ return (std::string("any"));
|
|
default:
|
|
default:
|
|
- return std::string("unknown");
|
|
|
|
|
|
+ return (std::string("unknown"));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
Element::types
|
|
Element::types
|
|
Element::nameToType(const std::string& type_name) {
|
|
Element::nameToType(const std::string& type_name) {
|
|
if (type_name == "integer") {
|
|
if (type_name == "integer") {
|
|
- return Element::integer;
|
|
|
|
|
|
+ return (Element::integer);
|
|
} else if (type_name == "real") {
|
|
} else if (type_name == "real") {
|
|
- return Element::real;
|
|
|
|
|
|
+ return (Element::real);
|
|
} else if (type_name == "boolean") {
|
|
} else if (type_name == "boolean") {
|
|
- return Element::boolean;
|
|
|
|
|
|
+ return (Element::boolean);
|
|
} else if (type_name == "string") {
|
|
} else if (type_name == "string") {
|
|
- return Element::string;
|
|
|
|
|
|
+ return (Element::string);
|
|
} else if (type_name == "list") {
|
|
} else if (type_name == "list") {
|
|
- return Element::list;
|
|
|
|
|
|
+ return (Element::list);
|
|
} else if (type_name == "map") {
|
|
} else if (type_name == "map") {
|
|
- return Element::map;
|
|
|
|
|
|
+ return (Element::map);
|
|
} else if (type_name == "null") {
|
|
} else if (type_name == "null") {
|
|
- return Element::null;
|
|
|
|
|
|
+ return (Element::null);
|
|
} else if (type_name == "any") {
|
|
} else if (type_name == "any") {
|
|
- return Element::any;
|
|
|
|
|
|
+ return (Element::any);
|
|
} else {
|
|
} else {
|
|
isc_throw(TypeError, type_name + " is not a valid type name");
|
|
isc_throw(TypeError, type_name + " is not a valid type name");
|
|
}
|
|
}
|
|
@@ -529,14 +525,14 @@ Element::nameToType(const std::string& type_name) {
|
|
ElementPtr
|
|
ElementPtr
|
|
Element::fromJSON(std::istream& in) throw(JSONError) {
|
|
Element::fromJSON(std::istream& in) throw(JSONError) {
|
|
int line = 1, pos = 1;
|
|
int line = 1, pos = 1;
|
|
- return fromJSON(in, "<istream>", line, pos);
|
|
|
|
|
|
+ return (fromJSON(in, "<istream>", line, pos));
|
|
}
|
|
}
|
|
|
|
|
|
ElementPtr
|
|
ElementPtr
|
|
Element::fromJSON(std::istream& in, const std::string& file_name) throw(JSONError)
|
|
Element::fromJSON(std::istream& in, const std::string& file_name) throw(JSONError)
|
|
{
|
|
{
|
|
int line = 1, pos = 1;
|
|
int line = 1, pos = 1;
|
|
- return fromJSON(in, file_name, line, pos);
|
|
|
|
|
|
+ return (fromJSON(in, file_name, line, pos));
|
|
}
|
|
}
|
|
|
|
|
|
ElementPtr
|
|
ElementPtr
|
|
@@ -602,7 +598,7 @@ Element::fromJSON(std::istream &in, const std::string& file, int& line, int& pos
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (el_read) {
|
|
if (el_read) {
|
|
- return element;
|
|
|
|
|
|
+ return (element);
|
|
} else {
|
|
} else {
|
|
isc_throw(JSONError, "nothing read");
|
|
isc_throw(JSONError, "nothing read");
|
|
}
|
|
}
|
|
@@ -612,7 +608,7 @@ ElementPtr
|
|
Element::fromJSON(const std::string &in) {
|
|
Element::fromJSON(const std::string &in) {
|
|
std::stringstream ss;
|
|
std::stringstream ss;
|
|
ss << in;
|
|
ss << in;
|
|
- return fromJSON(ss, "<string>");
|
|
|
|
|
|
+ return (fromJSON(ss, "<string>"));
|
|
}
|
|
}
|
|
|
|
|
|
// to JSON format
|
|
// to JSON format
|
|
@@ -698,18 +694,18 @@ ElementPtr
|
|
MapElement::find(const std::string& id) {
|
|
MapElement::find(const std::string& id) {
|
|
const size_t sep = id.find('/');
|
|
const size_t sep = id.find('/');
|
|
if (sep == std::string::npos) {
|
|
if (sep == std::string::npos) {
|
|
- return get(id);
|
|
|
|
|
|
+ return (get(id));
|
|
} else {
|
|
} else {
|
|
ElementPtr ce = get(id.substr(0, sep));
|
|
ElementPtr ce = get(id.substr(0, sep));
|
|
if (ce) {
|
|
if (ce) {
|
|
// ignore trailing slash
|
|
// ignore trailing slash
|
|
if (sep + 1 != id.size()) {
|
|
if (sep + 1 != id.size()) {
|
|
- return ce->find(id.substr(sep + 1));
|
|
|
|
|
|
+ return (ce->find(id.substr(sep + 1)));
|
|
} else {
|
|
} else {
|
|
- return ce;
|
|
|
|
|
|
+ return (ce);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- return ElementPtr();
|
|
|
|
|
|
+ return (ElementPtr());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -719,7 +715,7 @@ Element::fromWire(const std::string& s) {
|
|
std::stringstream ss;
|
|
std::stringstream ss;
|
|
ss << s;
|
|
ss << s;
|
|
int line = 0, pos = 0;
|
|
int line = 0, pos = 0;
|
|
- return fromJSON(ss, "<wire>", line, pos);
|
|
|
|
|
|
+ return (fromJSON(ss, "<wire>", line, pos));
|
|
}
|
|
}
|
|
|
|
|
|
ElementPtr
|
|
ElementPtr
|
|
@@ -735,7 +731,7 @@ Element::fromWire(std::stringstream& in, int length) {
|
|
//}
|
|
//}
|
|
//length -= 4;
|
|
//length -= 4;
|
|
int line = 0, pos = 0;
|
|
int line = 0, pos = 0;
|
|
- return fromJSON(in, "<wire>", line, pos);
|
|
|
|
|
|
+ return (fromJSON(in, "<wire>", line, pos));
|
|
}
|
|
}
|
|
|
|
|
|
void
|
|
void
|
|
@@ -749,12 +745,12 @@ MapElement::find(const std::string& id, ElementPtr& t) {
|
|
ElementPtr p = find(id);
|
|
ElementPtr p = find(id);
|
|
if (p) {
|
|
if (p) {
|
|
t = p;
|
|
t = p;
|
|
- return true;
|
|
|
|
|
|
+ return (true);
|
|
}
|
|
}
|
|
} catch (const TypeError& e) {
|
|
} catch (const TypeError& e) {
|
|
// ignore
|
|
// ignore
|
|
}
|
|
}
|
|
- return false;
|
|
|
|
|
|
+ return (false);
|
|
}
|
|
}
|
|
|
|
|
|
bool
|
|
bool
|
|
@@ -777,7 +773,7 @@ BoolElement::equals(ElementPtr other) {
|
|
|
|
|
|
bool
|
|
bool
|
|
NullElement::equals(ElementPtr other) {
|
|
NullElement::equals(ElementPtr other) {
|
|
- return other->getType() == Element::null;
|
|
|
|
|
|
+ return (other->getType() == Element::null);
|
|
}
|
|
}
|
|
|
|
|
|
bool
|
|
bool
|
|
@@ -791,16 +787,16 @@ ListElement::equals(ElementPtr other) {
|
|
if (other->getType() == Element::list) {
|
|
if (other->getType() == Element::list) {
|
|
const int s = size();
|
|
const int s = size();
|
|
if (s != other->size()) {
|
|
if (s != other->size()) {
|
|
- return false;
|
|
|
|
|
|
+ return (false);
|
|
}
|
|
}
|
|
for (int i = 0; i < s; ++i) {
|
|
for (int i = 0; i < s; ++i) {
|
|
if (!get(i)->equals(other->get(i))) {
|
|
if (!get(i)->equals(other->get(i))) {
|
|
- return false;
|
|
|
|
|
|
+ return (false);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return true;
|
|
|
|
|
|
+ return (true);
|
|
} else {
|
|
} else {
|
|
- return false;
|
|
|
|
|
|
+ return (false);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -812,10 +808,10 @@ MapElement::equals(ElementPtr other) {
|
|
it != m.end() ; ++it) {
|
|
it != m.end() ; ++it) {
|
|
if (other->contains((*it).first)) {
|
|
if (other->contains((*it).first)) {
|
|
if (!get((*it).first)->equals(other->get((*it).first))) {
|
|
if (!get((*it).first)->equals(other->get((*it).first))) {
|
|
- return false;
|
|
|
|
|
|
+ return (false);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- return false;
|
|
|
|
|
|
+ return (false);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// quickly walk through the other map too, to see if there's
|
|
// quickly walk through the other map too, to see if there's
|
|
@@ -827,18 +823,18 @@ MapElement::equals(ElementPtr other) {
|
|
for (std::map<std::string, ElementPtr>::const_iterator it = m.begin();
|
|
for (std::map<std::string, ElementPtr>::const_iterator it = m.begin();
|
|
it != m.end() ; ++it) {
|
|
it != m.end() ; ++it) {
|
|
if (!contains((*it).first)) {
|
|
if (!contains((*it).first)) {
|
|
- return false;
|
|
|
|
|
|
+ return (false);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return true;
|
|
|
|
|
|
+ return (true);
|
|
} else {
|
|
} else {
|
|
- return false;
|
|
|
|
|
|
+ return (false);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
bool
|
|
bool
|
|
isNull(ElementPtr p) {
|
|
isNull(ElementPtr p) {
|
|
- return !p;
|
|
|
|
|
|
+ return (!p);
|
|
}
|
|
}
|
|
|
|
|
|
void
|
|
void
|