latest changes from main rep

This commit is contained in:
Guenter Obiltschnig
2007-05-04 11:04:40 +00:00
parent 3580ad72cb
commit dcabc2befc
60 changed files with 1183 additions and 328 deletions

View File

@@ -1,7 +1,7 @@
//
// FileChannel.cpp
//
// $Id: //poco/Main/Foundation/src/FileChannel.cpp#18 $
// $Id: //poco/Main/Foundation/src/FileChannel.cpp#19 $
//
// Library: Foundation
// Package: Logging
@@ -46,7 +46,7 @@
#include "Poco/String.h"
#include "Poco/Timespan.h"
#include "Poco/Exception.h"
#include <ctype.h>
#include <cctype>
namespace Poco {
@@ -216,11 +216,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 && isspace(*it)) ++it;
while (it != end && isdigit(*it)) { n *= 10; n += *it++ - '0'; }
while (it != end && isspace(*it)) ++it;
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;
std::string unit;
while (it != end && isalpha(*it)) unit += *it++;
while (it != end && std::isalpha(*it)) unit += *it++;
RotateStrategy* pStrategy = 0;
if ((rotation.find(',') != std::string::npos) || (rotation.find(':') != std::string::npos))
@@ -299,11 +299,11 @@ void FileChannel::setPurgeAge(const std::string& age)
std::string::const_iterator it = age.begin();
std::string::const_iterator end = age.end();
int n = 0;
while (it != end && isspace(*it)) ++it;
while (it != end && isdigit(*it)) { n *= 10; n += *it++ - '0'; }
while (it != end && isspace(*it)) ++it;
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;
std::string unit;
while (it != end && isalpha(*it)) unit += *it++;
while (it != end && std::isalpha(*it)) unit += *it++;
Timespan::TimeDiff factor = Timespan::SECONDS;
if (unit == "minutes")
@@ -330,9 +330,9 @@ void FileChannel::setPurgeCount(const std::string& count)
std::string::const_iterator it = count.begin();
std::string::const_iterator end = count.end();
int n = 0;
while (it != end && isspace(*it)) ++it;
while (it != end && isdigit(*it)) { n *= 10; n += *it++ - '0'; }
while (it != end && isspace(*it)) ++it;
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;
delete _pPurgeStrategy;
_pPurgeStrategy = new PurgeByCountStrategy(n);