added Redis library

This commit is contained in:
Günter Obiltschnig
2017-11-08 15:48:04 +01:00
parent 47043e0f4f
commit 6a0191ae6c
93 changed files with 16311 additions and 40 deletions

69
Redis/src/Array.cpp Normal file
View File

@@ -0,0 +1,69 @@
//
// Array.h
//
// $Id$
//
// Library: Redis
// Package: Redis
// Module: Array
//
// Implementation of the Array class.
//
// Copyright (c) 2015, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#include "Poco/Redis/Array.h"
namespace Poco {
namespace Redis {
Array::Array()
{
}
Array::Array(const Array& copy):
_elements(copy._elements)
{
}
Array::~Array()
{
}
Array& Array::addRedisType(RedisType::Ptr value)
{
checkNull();
_elements.value().push_back(value);
return *this;
}
int Array::getType(size_t pos) const
{
if (_elements.isNull()) throw NullValueException();
if (pos >= _elements.value().size()) throw InvalidArgumentException();
RedisType::Ptr element = _elements.value().at(pos);
return element->type();
}
std::string Array::toString() const
{
return RedisTypeTraits<Array>::toString(*this);
}
} } // namespace Poco::Redis