mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-02-24 05:37:14 +01:00
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;
|
||
|
}
|