mirror of
https://github.com/pocoproject/poco.git
synced 2025-02-09 23:57:17 +01:00
Merge pull request #1060 from vmiklos/json-wshadow-fixes
GH #1050 JSON: fix gcc -Wshadow warnings
This commit is contained in:
commit
169297fed3
@ -74,9 +74,9 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Nullable(const C& value):
|
Nullable(const C& rValue):
|
||||||
/// Creates a Nullable with the given value.
|
/// Creates a Nullable with the given value.
|
||||||
_value(value),
|
_value(rValue),
|
||||||
_isNull(false)
|
_isNull(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -93,10 +93,10 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Nullable& assign(const C& value)
|
Nullable& assign(const C& rValue)
|
||||||
/// Assigns a value to the Nullable.
|
/// Assigns a value to the Nullable.
|
||||||
{
|
{
|
||||||
_value = value;
|
_value = rValue;
|
||||||
_isNull = false;
|
_isNull = false;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@ -116,10 +116,10 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
Nullable& operator = (const C& value)
|
Nullable& operator = (const C& rValue)
|
||||||
/// Assigns a value to the Nullable.
|
/// Assigns a value to the Nullable.
|
||||||
{
|
{
|
||||||
return assign(value);
|
return assign(rValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
Nullable& operator = (const Nullable& other)
|
Nullable& operator = (const Nullable& other)
|
||||||
@ -148,10 +148,10 @@ public:
|
|||||||
return (_isNull && other._isNull) || (_isNull == other._isNull && _value == other._value);
|
return (_isNull && other._isNull) || (_isNull == other._isNull && _value == other._value);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator == (const C& value) const
|
bool operator == (const C& rValue) const
|
||||||
/// Compares Nullable with value for equality
|
/// Compares Nullable with value for equality
|
||||||
{
|
{
|
||||||
return (!_isNull && _value == value);
|
return (!_isNull && _value == rValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator == (const NullType&) const
|
bool operator == (const NullType&) const
|
||||||
@ -160,10 +160,10 @@ public:
|
|||||||
return _isNull;
|
return _isNull;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator != (const C& value) const
|
bool operator != (const C& rValue) const
|
||||||
/// Compares Nullable with value for non equality
|
/// Compares Nullable with value for non equality
|
||||||
{
|
{
|
||||||
return !(*this == value);
|
return !(*this == rValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator != (const Nullable<C>& other) const
|
bool operator != (const Nullable<C>& other) const
|
||||||
|
@ -300,9 +300,9 @@ public:
|
|||||||
throw BadCastException();
|
throw BadCastException();
|
||||||
}
|
}
|
||||||
|
|
||||||
void convert(bool& value) const
|
void convert(bool& rValue) const
|
||||||
{
|
{
|
||||||
value = !_val.isNull() && _val->size() > 0;
|
rValue = !_val.isNull() && _val->size() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void convert(float&) const
|
void convert(float&) const
|
||||||
@ -439,9 +439,9 @@ public:
|
|||||||
throw BadCastException();
|
throw BadCastException();
|
||||||
}
|
}
|
||||||
|
|
||||||
void convert(bool& value) const
|
void convert(bool& rValue) const
|
||||||
{
|
{
|
||||||
value = _val.size() > 0;
|
rValue = _val.size() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void convert(float&) const
|
void convert(float&) const
|
||||||
|
@ -216,8 +216,8 @@ private:
|
|||||||
if (indent > 0) out << std::endl;
|
if (indent > 0) out << std::endl;
|
||||||
|
|
||||||
typename C::const_iterator it = container.begin();
|
typename C::const_iterator it = container.begin();
|
||||||
typename C::const_iterator end = container.end();
|
typename C::const_iterator itEnd = container.end();
|
||||||
for (; it != end;)
|
for (; it != itEnd;)
|
||||||
{
|
{
|
||||||
for(unsigned int i = 0; i < indent; i++) out << ' ';
|
for(unsigned int i = 0; i < indent; i++) out << ' ';
|
||||||
|
|
||||||
@ -392,9 +392,9 @@ public:
|
|||||||
throw BadCastException();
|
throw BadCastException();
|
||||||
}
|
}
|
||||||
|
|
||||||
void convert(bool& value) const
|
void convert(bool& rValue) const
|
||||||
{
|
{
|
||||||
value = !_val.isNull() && _val->size() > 0;
|
rValue = !_val.isNull() && _val->size() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void convert(float&) const
|
void convert(float&) const
|
||||||
@ -534,9 +534,9 @@ public:
|
|||||||
throw BadCastException();
|
throw BadCastException();
|
||||||
}
|
}
|
||||||
|
|
||||||
void convert(bool& value) const
|
void convert(bool& rValue) const
|
||||||
{
|
{
|
||||||
value = _val.size() > 0;
|
rValue = _val.size() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void convert(float&) const
|
void convert(float&) const
|
||||||
|
@ -119,9 +119,9 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
inline void PrintHandler::setIndent(unsigned indent)
|
inline void PrintHandler::setIndent(unsigned newIndent)
|
||||||
{
|
{
|
||||||
_indent = indent;
|
_indent = newIndent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -149,10 +149,10 @@ Array::operator const Poco::Dynamic::Array& () const
|
|||||||
if (!_pArray)
|
if (!_pArray)
|
||||||
{
|
{
|
||||||
ValueVec::const_iterator it = _values.begin();
|
ValueVec::const_iterator it = _values.begin();
|
||||||
ValueVec::const_iterator end = _values.end();
|
ValueVec::const_iterator itEnd = _values.end();
|
||||||
_pArray = new Poco::Dynamic::Array;
|
_pArray = new Poco::Dynamic::Array;
|
||||||
int index = 0;
|
int index = 0;
|
||||||
for (; it != end; ++it, ++index)
|
for (; it != itEnd; ++it, ++index)
|
||||||
{
|
{
|
||||||
if (isObject(it))
|
if (isObject(it))
|
||||||
{
|
{
|
||||||
|
@ -104,8 +104,8 @@ void Object::stringify(std::ostream& out, unsigned int indent, int step) const
|
|||||||
const std::string& Object::getKey(KeyPtrList::const_iterator& iter) const
|
const std::string& Object::getKey(KeyPtrList::const_iterator& iter) const
|
||||||
{
|
{
|
||||||
ValueMap::const_iterator it = _values.begin();
|
ValueMap::const_iterator it = _values.begin();
|
||||||
ValueMap::const_iterator end = _values.end();
|
ValueMap::const_iterator itEnd = _values.end();
|
||||||
for (; it != end; ++it)
|
for (; it != itEnd; ++it)
|
||||||
{
|
{
|
||||||
if (it->first == **iter) return it->first;
|
if (it->first == **iter) return it->first;
|
||||||
}
|
}
|
||||||
@ -121,8 +121,8 @@ void Object::set(const std::string& key, const Dynamic::Var& value)
|
|||||||
if (_preserveInsOrder)
|
if (_preserveInsOrder)
|
||||||
{
|
{
|
||||||
KeyPtrList::iterator it = _keys.begin();
|
KeyPtrList::iterator it = _keys.begin();
|
||||||
KeyPtrList::iterator end = _keys.end();
|
KeyPtrList::iterator itEnd = _keys.end();
|
||||||
for (; it != end; ++it)
|
for (; it != itEnd; ++it)
|
||||||
{
|
{
|
||||||
if (key == **it) return;
|
if (key == **it) return;
|
||||||
}
|
}
|
||||||
@ -164,9 +164,9 @@ Object::operator const Poco::DynamicStruct& () const
|
|||||||
if (!_pStruct)
|
if (!_pStruct)
|
||||||
{
|
{
|
||||||
ValueMap::const_iterator it = _values.begin();
|
ValueMap::const_iterator it = _values.begin();
|
||||||
ValueMap::const_iterator end = _values.end();
|
ValueMap::const_iterator itEnd = _values.end();
|
||||||
_pStruct = new Poco::DynamicStruct;
|
_pStruct = new Poco::DynamicStruct;
|
||||||
for (; it != end; ++it)
|
for (; it != itEnd; ++it)
|
||||||
{
|
{
|
||||||
if (isObject(it))
|
if (isObject(it))
|
||||||
{
|
{
|
||||||
|
@ -122,20 +122,20 @@ void ParseHandler::key(const std::string& k)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ParseHandler::setValue(const Var& value)
|
void ParseHandler::setValue(const Var& rValue)
|
||||||
{
|
{
|
||||||
Var parent = _stack.top();
|
Var parent = _stack.top();
|
||||||
|
|
||||||
if ( parent.type() == typeid(Array::Ptr) )
|
if ( parent.type() == typeid(Array::Ptr) )
|
||||||
{
|
{
|
||||||
Array::Ptr arr = parent.extract<Array::Ptr>();
|
Array::Ptr arr = parent.extract<Array::Ptr>();
|
||||||
arr->add(value);
|
arr->add(rValue);
|
||||||
}
|
}
|
||||||
else if ( parent.type() == typeid(Object::Ptr) )
|
else if ( parent.type() == typeid(Object::Ptr) )
|
||||||
{
|
{
|
||||||
poco_assert_dbg(!_key.empty());
|
poco_assert_dbg(!_key.empty());
|
||||||
Object::Ptr obj = parent.extract<Object::Ptr>();
|
Object::Ptr obj = parent.extract<Object::Ptr>();
|
||||||
obj->set(_key, value);
|
obj->set(_key, rValue);
|
||||||
_key.clear();
|
_key.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,18 +23,18 @@ namespace Poco {
|
|||||||
namespace JSON {
|
namespace JSON {
|
||||||
|
|
||||||
|
|
||||||
PrintHandler::PrintHandler(unsigned indent):
|
PrintHandler::PrintHandler(unsigned newIndent):
|
||||||
_out(std::cout),
|
_out(std::cout),
|
||||||
_indent(indent),
|
_indent(newIndent),
|
||||||
_array(0),
|
_array(0),
|
||||||
_objStart(true)
|
_objStart(true)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PrintHandler::PrintHandler(std::ostream& out, unsigned indent):
|
PrintHandler::PrintHandler(std::ostream& out, unsigned newIndent):
|
||||||
_out(out),
|
_out(out),
|
||||||
_indent(indent),
|
_indent(newIndent),
|
||||||
_array(0),
|
_array(0),
|
||||||
_objStart(true)
|
_objStart(true)
|
||||||
{
|
{
|
||||||
@ -172,10 +172,10 @@ void PrintHandler::value(UInt64 v)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void PrintHandler::value(const std::string& value)
|
void PrintHandler::value(const std::string& rValue)
|
||||||
{
|
{
|
||||||
arrayValue();
|
arrayValue();
|
||||||
Stringifier::formatString(value, _out);
|
Stringifier::formatString(rValue, _out);
|
||||||
_objStart = false;
|
_objStart = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user