summaryrefslogtreecommitdiff
path: root/src/minicron.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-01-20 18:09:04 +0000
committerMike Buland <eichlan@xagasoft.com>2011-01-20 18:09:04 +0000
commit393f1b414746a7f1977971dd7659dd2b47092b11 (patch)
tree81d0ca1ee70ab86a7d79c1991abe5c387b655fb2 /src/minicron.cpp
parentc259f95bd0e58b247940a339bb9b4b401b4e9438 (diff)
parent7e25a863325dc3e9762397e700030969e093b087 (diff)
downloadlibbu++-393f1b414746a7f1977971dd7659dd2b47092b11.tar.gz
libbu++-393f1b414746a7f1977971dd7659dd2b47092b11.tar.bz2
libbu++-393f1b414746a7f1977971dd7659dd2b47092b11.tar.xz
libbu++-393f1b414746a7f1977971dd7659dd2b47092b11.zip
Wow! Merged the branch, streams are updated, and there's no more FString, run
the fixstrings.sh script in the support directory to (hopefully) automatically update your projects.
Diffstat (limited to 'src/minicron.cpp')
-rw-r--r--src/minicron.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/minicron.cpp b/src/minicron.cpp
index 491d143..3375492 100644
--- a/src/minicron.cpp
+++ b/src/minicron.cpp
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2007-2010 Xagasoft, All rights reserved. 2 * Copyright (C) 2007-2011 Xagasoft, All rights reserved.
3 * 3 *
4 * This file is part of the libbu++ library and is released under the 4 * This file is part of the libbu++ library and is released under the
5 * terms of the license contained in the file LICENSE. 5 * terms of the license contained in the file LICENSE.
@@ -73,7 +73,7 @@ void Bu::MiniCron::poll()
73 } 73 }
74} 74}
75 75
76Bu::MiniCron::JobId Bu::MiniCron::addJob( const Bu::FString &sName, 76Bu::MiniCron::JobId Bu::MiniCron::addJob( const Bu::String &sName,
77 Bu::MiniCron::CronSignal sigJob, const Bu::MiniCron::Timer &t ) 77 Bu::MiniCron::CronSignal sigJob, const Bu::MiniCron::Timer &t )
78{ 78{
79 JobId jid = jidNext++; 79 JobId jid = jidNext++;
@@ -86,7 +86,7 @@ Bu::MiniCron::JobId Bu::MiniCron::addJob( const Bu::FString &sName,
86 return jid; 86 return jid;
87} 87}
88 88
89Bu::MiniCron::JobId Bu::MiniCron::addJobOnce( const Bu::FString &sName, 89Bu::MiniCron::JobId Bu::MiniCron::addJobOnce( const Bu::String &sName,
90 Bu::MiniCron::CronSignal sigJob, const Bu::MiniCron::Timer &t ) 90 Bu::MiniCron::CronSignal sigJob, const Bu::MiniCron::Timer &t )
91{ 91{
92 JobId jid = jidNext++; 92 JobId jid = jidNext++;
@@ -132,7 +132,7 @@ Bu::MiniCron::JobInfoList Bu::MiniCron::getJobInfo()
132 return lRet; 132 return lRet;
133} 133}
134 134
135Bu::MiniCron::Job::Job( const Bu::FString &sName, JobId jid, bool bRepeat ) : 135Bu::MiniCron::Job::Job( const Bu::String &sName, JobId jid, bool bRepeat ) :
136 sName( sName ), 136 sName( sName ),
137 pTimer( NULL ), 137 pTimer( NULL ),
138 bContinue( bRepeat ), 138 bContinue( bRepeat ),
@@ -202,12 +202,12 @@ time_t Bu::MiniCron::Job::getNextRunTime() const
202 return tNextRun; 202 return tNextRun;
203} 203}
204 204
205Bu::FString Bu::MiniCron::Job::getName() const 205Bu::String Bu::MiniCron::Job::getName() const
206{ 206{
207 return sName; 207 return sName;
208} 208}
209 209
210Bu::MiniCron::JobInfo::JobInfo( const Bu::FString &sName, JobId jid, 210Bu::MiniCron::JobInfo::JobInfo( const Bu::String &sName, JobId jid,
211 time_t tNext ) : 211 time_t tNext ) :
212 sName( sName ), 212 sName( sName ),
213 jid( jid ), 213 jid( jid ),
@@ -249,7 +249,7 @@ time_t Bu::MiniCron::TimerInterval::nextTime()
249 return tRet; 249 return tRet;
250} 250}
251 251
252Bu::MiniCron::TimerBasic::TimerBasic( const Bu::FString &s ) : 252Bu::MiniCron::TimerBasic::TimerBasic( const Bu::String &s ) :
253 tLast( -1 ), 253 tLast( -1 ),
254 sSpec( s ) 254 sSpec( s )
255{ 255{
@@ -264,7 +264,7 @@ time_t Bu::MiniCron::TimerBasic::nextTime()
264 if( tLast == -1 ) 264 if( tLast == -1 )
265 tLast = time( NULL ); 265 tLast = time( NULL );
266 266
267 Bu::FString::const_iterator i = sSpec.begin(); 267 Bu::String::const_iterator i = sSpec.begin();
268 switch( lex( i ) ) 268 switch( lex( i ) )
269 { 269 {
270 case tokDaily: 270 case tokDaily:
@@ -343,19 +343,19 @@ time_t Bu::MiniCron::TimerBasic::nextTime()
343} 343}
344 344
345Bu::MiniCron::TimerBasic::Token Bu::MiniCron::TimerBasic::lex( 345Bu::MiniCron::TimerBasic::Token Bu::MiniCron::TimerBasic::lex(
346 Bu::FString::const_iterator &i ) 346 Bu::String::const_iterator &i )
347{ 347{
348 if( !i ) 348 if( !i )
349 { 349 {
350 return tokEos; 350 return tokEos;
351 } 351 }
352 352
353 Bu::FString::const_iterator b = i; 353 Bu::String::const_iterator b = i;
354 354
355 for(; b && (*b == ' ' || *b == '\t'); b++ ) { i = b+1; } 355 for(; b && (*b == ' ' || *b == '\t'); b++ ) { i = b+1; }
356 for(; b && *b != ' ' && *b != '\t'; b++ ) { } 356 for(; b && *b != ' ' && *b != '\t'; b++ ) { }
357 357
358 Bu::FString sTok( i, b ); 358 Bu::String sTok( i, b );
359 i = b; 359 i = b;
360 360
361 if( sTok == "daily" ) 361 if( sTok == "daily" )
@@ -412,7 +412,7 @@ Bu::MiniCron::TimerBasic::Token Bu::MiniCron::TimerBasic::lex(
412 return tokErr; 412 return tokErr;
413} 413}
414 414
415int Bu::MiniCron::TimerBasic::lexInt( Bu::FString::const_iterator &i ) 415int Bu::MiniCron::TimerBasic::lexInt( Bu::String::const_iterator &i )
416{ 416{
417 Token t = lex( i ); 417 Token t = lex( i );
418 if( t == tokEos ) 418 if( t == tokEos )