mirror of
https://github.com/pocoproject/poco.git
synced 2025-04-16 15:01:15 +02:00
the great line endings cleanup
This commit is contained in:
parent
2a0dcd1785
commit
79eab26377
@ -39,13 +39,16 @@
|
|||||||
#ifndef Data_MySQL_Connector_INCLUDED
|
#ifndef Data_MySQL_Connector_INCLUDED
|
||||||
#define Data_MySQL_Connector_INCLUDED
|
#define Data_MySQL_Connector_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "MySQL.h"
|
#include "MySQL.h"
|
||||||
#include "Poco/Data/Connector.h"
|
#include "Poco/Data/Connector.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Poco {
|
namespace Poco {
|
||||||
namespace Data {
|
namespace Data {
|
||||||
namespace MySQL {
|
namespace MySQL {
|
||||||
|
|
||||||
|
|
||||||
class MySQL_API Connector: public Poco::Data::Connector
|
class MySQL_API Connector: public Poco::Data::Connector
|
||||||
/// Connector instantiates MySQL SessionImpl objects.
|
/// Connector instantiates MySQL SessionImpl objects.
|
||||||
{
|
{
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
#include "Poco/Data/MySQL/MySQL.h"
|
#include "Poco/Data/MySQL/MySQL.h"
|
||||||
#include "Poco/Data/Session.h"
|
#include "Poco/Data/Session.h"
|
||||||
|
|
||||||
|
|
||||||
class SQLExecutor: public CppUnit::TestCase
|
class SQLExecutor: public CppUnit::TestCase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -90,10 +90,15 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
Pair& swap(Pair& other)
|
Pair& swap(Pair& other)
|
||||||
|
|
||||||
/// Swaps the content of the two Pairs.
|
/// Swaps the content of the two Pairs.
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
std::swap(_data, other._data);
|
std::swap(_data, other._data);
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Pair& operator = (const Pair& other)
|
Pair& operator = (const Pair& other)
|
||||||
|
@ -87,6 +87,7 @@ namespace Poco {
|
|||||||
#endif //POCO_NO_WSTRING
|
#endif //POCO_NO_WSTRING
|
||||||
//#endif // POCO_ENABLE_CPP11
|
//#endif // POCO_ENABLE_CPP11
|
||||||
|
|
||||||
|
|
||||||
} // namespace Poco
|
} // namespace Poco
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// DigestStreamTest.cpp
|
// DigestStreamTest.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/1.4/Foundation/testsuite/src/DigestStreamTest.cpp#1 $
|
// $Id: //poco/1.4/Foundation/testsuite/src/DigestStreamTest.cpp#1 $
|
||||||
|
|
||||||
//
|
//
|
||||||
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
||||||
// and Contributors.
|
// and Contributors.
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
|
|
||||||
#if defined(_MSC_VER) && _MSC_VER < 1400
|
#if defined(_MSC_VER) && _MSC_VER < 1400
|
||||||
#pragma warning(disable:4800)//forcing value to bool 'true' or 'false'
|
#pragma warning(disable:4800)//forcing value to bool 'true' or 'false'
|
||||||
#endif
|
#endif
|
||||||
|
@ -697,4 +697,5 @@ bool Parser::readElements(bool firstCall)
|
|||||||
throw JSONException(format("Invalid token '%s' found.", token->asString()));
|
throw JSONException(format("Invalid token '%s' found.", token->asString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} } // namespace Poco::JSON
|
} } // namespace Poco::JSON
|
||||||
|
@ -33,7 +33,6 @@
|
|||||||
#include "JSONTest.h"
|
#include "JSONTest.h"
|
||||||
#include "CppUnit/TestCaller.h"
|
#include "CppUnit/TestCaller.h"
|
||||||
#include "CppUnit/TestSuite.h"
|
#include "CppUnit/TestSuite.h"
|
||||||
|
|
||||||
#include "Poco/JSON/Object.h"
|
#include "Poco/JSON/Object.h"
|
||||||
#include "Poco/JSON/Parser.h"
|
#include "Poco/JSON/Parser.h"
|
||||||
#include "Poco/JSON/Query.h"
|
#include "Poco/JSON/Query.h"
|
||||||
@ -41,15 +40,14 @@
|
|||||||
#include "Poco/JSON/Stringifier.h"
|
#include "Poco/JSON/Stringifier.h"
|
||||||
#include "Poco/JSON/DefaultHandler.h"
|
#include "Poco/JSON/DefaultHandler.h"
|
||||||
#include "Poco/JSON/Template.h"
|
#include "Poco/JSON/Template.h"
|
||||||
|
|
||||||
#include "Poco/Path.h"
|
#include "Poco/Path.h"
|
||||||
#include "Poco/Environment.h"
|
#include "Poco/Environment.h"
|
||||||
#include "Poco/File.h"
|
#include "Poco/File.h"
|
||||||
#include "Poco/FileStream.h"
|
#include "Poco/FileStream.h"
|
||||||
#include "Poco/Glob.h"
|
#include "Poco/Glob.h"
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
|
|
||||||
using namespace Poco::JSON;
|
using namespace Poco::JSON;
|
||||||
using namespace Poco::Dynamic;
|
using namespace Poco::Dynamic;
|
||||||
|
|
||||||
|
@ -40,14 +40,15 @@
|
|||||||
#define Util_JSONConfiguration_INCLUDED
|
#define Util_JSONConfiguration_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include <istream>
|
|
||||||
|
|
||||||
#include "Poco/Util/AbstractConfiguration.h"
|
#include "Poco/Util/AbstractConfiguration.h"
|
||||||
#include "Poco/JSON/Object.h"
|
#include "Poco/JSON/Object.h"
|
||||||
|
#include <istream>
|
||||||
|
|
||||||
|
|
||||||
namespace Poco {
|
namespace Poco {
|
||||||
namespace Util {
|
namespace Util {
|
||||||
|
|
||||||
|
|
||||||
class Util_API JSONConfiguration : public AbstractConfiguration
|
class Util_API JSONConfiguration : public AbstractConfiguration
|
||||||
/// This configuration class extracts configuration properties
|
/// This configuration class extracts configuration properties
|
||||||
/// from a JSON object. An XPath-like syntax for property
|
/// from a JSON object. An XPath-like syntax for property
|
||||||
@ -154,6 +155,7 @@ private:
|
|||||||
JSON::Object::Ptr _object;
|
JSON::Object::Ptr _object;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
} } // namespace Poco::Util
|
} } // namespace Poco::Util
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,12 +35,15 @@
|
|||||||
#include "Poco/Util/Units.h"
|
#include "Poco/Util/Units.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
|
||||||
using namespace Poco::Util::Units::Values;
|
using namespace Poco::Util::Units::Values;
|
||||||
using namespace Poco::Util::Units::Constants;
|
using namespace Poco::Util::Units::Constants;
|
||||||
|
|
||||||
|
|
||||||
using Poco::Util::Units::square;
|
using Poco::Util::Units::square;
|
||||||
using Poco::Util::Units::cube;
|
using Poco::Util::Units::cube;
|
||||||
|
|
||||||
|
|
||||||
namespace Poco {
|
namespace Poco {
|
||||||
namespace Util {
|
namespace Util {
|
||||||
namespace Units {
|
namespace Units {
|
||||||
|
@ -32,6 +32,8 @@
|
|||||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#include "Poco/FileStream.h"
|
#include "Poco/FileStream.h"
|
||||||
#include "Poco/StringTokenizer.h"
|
#include "Poco/StringTokenizer.h"
|
||||||
#include "Poco/Util/JSONConfiguration.h"
|
#include "Poco/Util/JSONConfiguration.h"
|
||||||
@ -41,10 +43,10 @@
|
|||||||
#include "Poco/RegularExpression.h"
|
#include "Poco/RegularExpression.h"
|
||||||
#include "Poco/NumberParser.h"
|
#include "Poco/NumberParser.h"
|
||||||
|
|
||||||
namespace Poco
|
|
||||||
{
|
namespace Poco {
|
||||||
namespace Util
|
namespace Util {
|
||||||
{
|
|
||||||
|
|
||||||
JSONConfiguration::JSONConfiguration() : _object(new JSON::Object())
|
JSONConfiguration::JSONConfiguration() : _object(new JSON::Object())
|
||||||
{
|
{
|
||||||
@ -140,6 +142,7 @@ void JSONConfiguration::getIndexes(std::string& name, std::vector<int>& indexes)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
JSON::Object::Ptr JSONConfiguration::findStart(const std::string& key, std::string& lastPart)
|
JSON::Object::Ptr JSONConfiguration::findStart(const std::string& key, std::string& lastPart)
|
||||||
{
|
{
|
||||||
JSON::Object::Ptr currentObject = _object;
|
JSON::Object::Ptr currentObject = _object;
|
||||||
@ -254,13 +257,19 @@ JSON::Object::Ptr JSONConfiguration::findStart(const std::string& key, std::stri
|
|||||||
return currentObject;
|
return currentObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JSONConfiguration::setValue(const std::string& key, const Poco::DynamicAny& value)
|
void JSONConfiguration::setValue(const std::string& key, const Poco::DynamicAny& value)
|
||||||
{
|
{
|
||||||
|
|
||||||
std::string sValue;
|
std::string sValue;
|
||||||
|
|
||||||
value.convert<std::string>(sValue);
|
value.convert<std::string>(sValue);
|
||||||
KeyValue kv(key, sValue);
|
KeyValue kv(key, sValue);
|
||||||
|
|
||||||
if (eventsEnabled())
|
if (eventsEnabled())
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
propertyChanging(this, kv);
|
propertyChanging(this, kv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -305,12 +314,16 @@ void JSONConfiguration::setValue(const std::string& key, const Poco::DynamicAny&
|
|||||||
}
|
}
|
||||||
arr->add(value);
|
arr->add(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eventsEnabled())
|
if (eventsEnabled())
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
propertyChanged(this, kv);
|
propertyChanged(this, kv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JSONConfiguration::setString(const std::string& key, const std::string& value)
|
void JSONConfiguration::setString(const std::string& key, const std::string& value)
|
||||||
{
|
{
|
||||||
setValue(key, value);
|
setValue(key, value);
|
||||||
@ -322,21 +335,25 @@ void JSONConfiguration::setRaw(const std::string& key, const std::string& value)
|
|||||||
setValue(key, value);
|
setValue(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JSONConfiguration::setInt(const std::string& key, int value)
|
void JSONConfiguration::setInt(const std::string& key, int value)
|
||||||
{
|
{
|
||||||
setValue(key, value);
|
setValue(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JSONConfiguration::setBool(const std::string& key, bool value)
|
void JSONConfiguration::setBool(const std::string& key, bool value)
|
||||||
{
|
{
|
||||||
setValue(key, value);
|
setValue(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JSONConfiguration::setDouble(const std::string& key, double value)
|
void JSONConfiguration::setDouble(const std::string& key, double value)
|
||||||
{
|
{
|
||||||
setValue(key, value);
|
setValue(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JSONConfiguration::enumerate(const std::string& key, Keys& range) const
|
void JSONConfiguration::enumerate(const std::string& key, Keys& range) const
|
||||||
{
|
{
|
||||||
JSON::Query query(_object);
|
JSON::Query query(_object);
|
||||||
@ -354,11 +371,13 @@ void JSONConfiguration::save(std::ostream& ostr, unsigned int indent) const
|
|||||||
_object->stringify(ostr, indent);
|
_object->stringify(ostr, indent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void JSONConfiguration::removeRaw(const std::string& key)
|
void JSONConfiguration::removeRaw(const std::string& key)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
std::string lastPart;
|
std::string lastPart;
|
||||||
JSON::Object::Ptr parentObject = findStart(key, lastPart);
|
JSON::Object::Ptr parentObject = findStart(key, lastPart);
|
||||||
|
|
||||||
std::vector<int> indexes;
|
std::vector<int> indexes;
|
||||||
getIndexes(lastPart, indexes);
|
getIndexes(lastPart, indexes);
|
||||||
|
|
||||||
@ -369,8 +388,9 @@ void JSONConfiguration::removeRaw(const std::string& key)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
DynamicAny result = parentObject->get(lastPart);
|
DynamicAny result = parentObject->get(lastPart);
|
||||||
if ( !result.isEmpty() && result.type() == typeid(JSON::Array::Ptr) )
|
if (!result.isEmpty() && result.type() == typeid(JSON::Array::Ptr))
|
||||||
{
|
{
|
||||||
|
|
||||||
JSON::Array::Ptr arr = result.extract<JSON::Array::Ptr>();
|
JSON::Array::Ptr arr = result.extract<JSON::Array::Ptr>();
|
||||||
for(std::vector<int>::iterator it = indexes.begin(); it != indexes.end() - 1; ++it)
|
for(std::vector<int>::iterator it = indexes.begin(); it != indexes.end() - 1; ++it)
|
||||||
{
|
{
|
||||||
@ -379,6 +399,8 @@ void JSONConfiguration::removeRaw(const std::string& key)
|
|||||||
arr->remove(indexes.back());
|
arr->remove(indexes.back());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}} // Namespace Poco::Util
|
|
||||||
|
} } // namespace Poco::Util
|
||||||
|
Loading…
x
Reference in New Issue
Block a user