mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-06 00:31:10 +01:00
trunk/branch integration: using Poco::Ascii & memoryleak fix
This commit is contained in:
parent
4cea48e712
commit
9cf13e2976
@ -46,7 +46,7 @@
|
||||
#include "Poco/String.h"
|
||||
#include "Poco/Timespan.h"
|
||||
#include "Poco/Exception.h"
|
||||
#include <cctype>
|
||||
#include "Poco/Ascii.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
@ -220,11 +220,11 @@ void FileChannel::setRotation(const std::string& rotation)
|
||||
std::string::const_iterator it = rotation.begin();
|
||||
std::string::const_iterator end = rotation.end();
|
||||
int n = 0;
|
||||
while (it != end && std::isspace(*it)) ++it;
|
||||
while (it != end && std::isdigit(*it)) { n *= 10; n += *it++ - '0'; }
|
||||
while (it != end && std::isspace(*it)) ++it;
|
||||
while (it != end && Ascii::isSpace(*it)) ++it;
|
||||
while (it != end && Ascii::isDigit(*it)) { n *= 10; n += *it++ - '0'; }
|
||||
while (it != end && Ascii::isSpace(*it)) ++it;
|
||||
std::string unit;
|
||||
while (it != end && std::isalpha(*it)) unit += *it++;
|
||||
while (it != end && Ascii::isAlpha(*it)) unit += *it++;
|
||||
|
||||
RotateStrategy* pStrategy = 0;
|
||||
if ((rotation.find(',') != std::string::npos) || (rotation.find(':') != std::string::npos))
|
||||
@ -311,11 +311,11 @@ void FileChannel::setPurgeAge(const std::string& age)
|
||||
std::string::const_iterator end = age.end();
|
||||
|
||||
int n = 0;
|
||||
while (it != end && std::isspace(*it)) ++it;
|
||||
while (it != end && std::isdigit(*it)) { n *= 10; n += *it++ - '0'; }
|
||||
while (it != end && std::isspace(*it)) ++it;
|
||||
while (it != end && Ascii::isSpace(*it)) ++it;
|
||||
while (it != end && Ascii::isDigit(*it)) { n *= 10; n += *it++ - '0'; }
|
||||
while (it != end && Ascii::isSpace(*it)) ++it;
|
||||
std::string unit;
|
||||
while (it != end && std::isalpha(*it)) unit += *it++;
|
||||
while (it != end && Ascii::isAlpha(*it)) unit += *it++;
|
||||
|
||||
Timespan::TimeDiff factor = Timespan::SECONDS;
|
||||
if (unit == "minutes")
|
||||
|
Loading…
Reference in New Issue
Block a user