mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-26 02:18:04 +01:00
latest changes from main rep
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user