the great line endings cleanup

This commit is contained in:
Guenter Obiltschnig 2012-11-11 09:57:01 +01:00
parent 2a0dcd1785
commit 79eab26377
620 changed files with 132030 additions and 131992 deletions

View File

@ -39,13 +39,16 @@
#ifndef Data_MySQL_Connector_INCLUDED
#define Data_MySQL_Connector_INCLUDED
#include "MySQL.h"
#include "Poco/Data/Connector.h"
namespace Poco {
namespace Data {
namespace MySQL {
class MySQL_API Connector: public Poco::Data::Connector
/// Connector instantiates MySQL SessionImpl objects.
{

View File

@ -39,6 +39,7 @@
#include "Poco/Data/MySQL/MySQL.h"
#include "Poco/Data/Session.h"
class SQLExecutor: public CppUnit::TestCase
{
public:

View File

@ -90,10 +90,15 @@ public:
}
Pair& swap(Pair& other)
/// Swaps the content of the two Pairs.
{
std::swap(_data, other._data);
return *this;
}
Pair& operator = (const Pair& other)

View File

@ -87,6 +87,7 @@ namespace Poco {
#endif //POCO_NO_WSTRING
//#endif // POCO_ENABLE_CPP11
} // namespace Poco

View File

@ -2,6 +2,7 @@
// DigestStreamTest.cpp
//
// $Id: //poco/1.4/Foundation/testsuite/src/DigestStreamTest.cpp#1 $
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
@ -95,10 +96,10 @@ void DigestStreamTest::testOutputStream2()
void DigestStreamTest::testToFromHex()
{
std::string digest("c3fcd3d76192e4007dfb496cca67e13b");
Poco::DigestEngine::Digest dig = DigestEngine::digestFromHex(digest);
std::string digest2 = DigestEngine::digestToHex(dig);
assert (digest == digest2);
std::string digest("c3fcd3d76192e4007dfb496cca67e13b");
Poco::DigestEngine::Digest dig = DigestEngine::digestFromHex(digest);
std::string digest2 = DigestEngine::digestToHex(dig);
assert (digest == digest2);
}
@ -116,10 +117,10 @@ CppUnit::Test* DigestStreamTest::suite()
{
CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("DigestStreamTest");
CppUnit_addTest(pSuite, DigestStreamTest, testInputStream);
CppUnit_addTest(pSuite, DigestStreamTest, testOutputStream1);
CppUnit_addTest(pSuite, DigestStreamTest, testOutputStream2);
CppUnit_addTest(pSuite, DigestStreamTest, testToFromHex);
CppUnit_addTest(pSuite, DigestStreamTest, testInputStream);
CppUnit_addTest(pSuite, DigestStreamTest, testOutputStream1);
CppUnit_addTest(pSuite, DigestStreamTest, testOutputStream2);
CppUnit_addTest(pSuite, DigestStreamTest, testToFromHex);
return pSuite;
return pSuite;
}

View File

@ -41,6 +41,7 @@
#include <map>
#include <utility>
#if defined(_MSC_VER) && _MSC_VER < 1400
#pragma warning(disable:4800)//forcing value to bool 'true' or 'false'
#endif

View File

@ -697,4 +697,5 @@ bool Parser::readElements(bool firstCall)
throw JSONException(format("Invalid token '%s' found.", token->asString()));
}
} } // namespace Poco::JSON

View File

@ -33,7 +33,6 @@
#include "JSONTest.h"
#include "CppUnit/TestCaller.h"
#include "CppUnit/TestSuite.h"
#include "Poco/JSON/Object.h"
#include "Poco/JSON/Parser.h"
#include "Poco/JSON/Query.h"
@ -41,15 +40,14 @@
#include "Poco/JSON/Stringifier.h"
#include "Poco/JSON/DefaultHandler.h"
#include "Poco/JSON/Template.h"
#include "Poco/Path.h"
#include "Poco/Environment.h"
#include "Poco/File.h"
#include "Poco/FileStream.h"
#include "Poco/Glob.h"
#include <set>
using namespace Poco::JSON;
using namespace Poco::Dynamic;

View File

@ -40,14 +40,15 @@
#define Util_JSONConfiguration_INCLUDED
#include <istream>
#include "Poco/Util/AbstractConfiguration.h"
#include "Poco/JSON/Object.h"
#include <istream>
namespace Poco {
namespace Util {
class Util_API JSONConfiguration : public AbstractConfiguration
/// This configuration class extracts configuration properties
/// from a JSON object. An XPath-like syntax for property
@ -154,6 +155,7 @@ private:
JSON::Object::Ptr _object;
};
} } // namespace Poco::Util

View File

@ -35,12 +35,15 @@
#include "Poco/Util/Units.h"
#include <iostream>
using namespace Poco::Util::Units::Values;
using namespace Poco::Util::Units::Constants;
using Poco::Util::Units::square;
using Poco::Util::Units::cube;
namespace Poco {
namespace Util {
namespace Units {

View File

@ -32,6 +32,8 @@
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
#include "Poco/FileStream.h"
#include "Poco/StringTokenizer.h"
#include "Poco/Util/JSONConfiguration.h"
@ -41,10 +43,10 @@
#include "Poco/RegularExpression.h"
#include "Poco/NumberParser.h"
namespace Poco
{
namespace Util
{
namespace Poco {
namespace Util {
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 currentObject = _object;
@ -254,13 +257,19 @@ JSON::Object::Ptr JSONConfiguration::findStart(const std::string& key, std::stri
return currentObject;
}
void JSONConfiguration::setValue(const std::string& key, const Poco::DynamicAny& value)
{
std::string sValue;
value.convert<std::string>(sValue);
KeyValue kv(key, sValue);
if (eventsEnabled())
{
propertyChanging(this, kv);
}
@ -305,12 +314,16 @@ void JSONConfiguration::setValue(const std::string& key, const Poco::DynamicAny&
}
arr->add(value);
}
if (eventsEnabled())
{
propertyChanged(this, kv);
}
}
void JSONConfiguration::setString(const std::string& key, const std::string& value)
{
setValue(key, value);
@ -322,21 +335,25 @@ void JSONConfiguration::setRaw(const std::string& key, const std::string& value)
setValue(key, value);
}
void JSONConfiguration::setInt(const std::string& key, int value)
{
setValue(key, value);
}
void JSONConfiguration::setBool(const std::string& key, bool value)
{
setValue(key, value);
}
void JSONConfiguration::setDouble(const std::string& key, double value)
{
setValue(key, value);
}
void JSONConfiguration::enumerate(const std::string& key, Keys& range) const
{
JSON::Query query(_object);
@ -354,11 +371,13 @@ void JSONConfiguration::save(std::ostream& ostr, unsigned int indent) const
_object->stringify(ostr, indent);
}
void JSONConfiguration::removeRaw(const std::string& key)
{
std::string lastPart;
JSON::Object::Ptr parentObject = findStart(key, lastPart);
std::vector<int> indexes;
getIndexes(lastPart, indexes);
@ -369,8 +388,9 @@ void JSONConfiguration::removeRaw(const std::string& key)
else
{
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>();
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());
}
}
}
}} // Namespace Poco::Util
} } // namespace Poco::Util