mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-02-23 21:27:14 +01:00
Switched to POCO library for unified platform/library interface. Deprecated the external module API. It was creating more problems than solving. Removed most built-in libraries in favor of system libraries for easier maintenance. Cleaned and secured code with help from static analyzers.
47 lines
725 B
C++
47 lines
725 B
C++
//
|
|
// Page.cpp
|
|
//
|
|
// Copyright (c) 2008, Applied Informatics Software Engineering GmbH.
|
|
// and Contributors.
|
|
//
|
|
// SPDX-License-Identifier: BSL-1.0
|
|
//
|
|
|
|
|
|
#include "Page.h"
|
|
#include "Poco/String.h"
|
|
#include "Poco/NumberParser.h"
|
|
|
|
|
|
Page::Page()
|
|
{
|
|
}
|
|
|
|
|
|
Page::~Page()
|
|
{
|
|
}
|
|
|
|
|
|
bool Page::getBool(const std::string& property, bool deflt) const
|
|
{
|
|
if (has(property))
|
|
{
|
|
const std::string& value = get(property);
|
|
return Poco::icompare(value, "true") == 0
|
|
|| Poco::icompare(value, "yes") == 0
|
|
|| Poco::icompare(value, "on") == 0;
|
|
}
|
|
else return deflt;
|
|
}
|
|
|
|
|
|
int Page::getInt(const std::string& property, int deflt) const
|
|
{
|
|
if (has(property))
|
|
{
|
|
return Poco::NumberParser::parse(get(property));
|
|
}
|
|
else return deflt;
|
|
}
|