A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/ncbitime_8cpp_source.html below:

NCBI C++ ToolKit: src/corelib/ncbitime.cpp Source File

41 #if defined(NCBI_OS_MSWIN) 43 #elif defined(NCBI_OS_UNIX) 44 # include <sys/time.h> 50 #if defined(__CYGWIN__) || defined(NCBI_COMPILER_MSVC) 51 # define TimeZone() _timezone 52 # define Daylight() _daylight 53 # define TZName() _tzname 55 # define TimeZone() timezone 56 # define Daylight() daylight 57 # define TZName() tzname 61 #if defined(NCBI_OS_DARWIN) || defined(NCBI_OS_BSD) 62 # define NCBI_TIMEZONE_IS_UNDEFINED 1 67 #if defined(NCBI_COMPILER_MSVC) 68 # define DSTBias() _dstbias 70 # define DSTBias() -3600 74 #define NCBI_USE_ERRCODE_X Corelib_Util 98

31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31

103  "Jan"

,

"Feb"

,

"Mar"

,

"Apr"

,

"May"

,

"Jun"

,

104  "Jul"

,

"Aug"

,

"Sep"

,

"Oct"

,

"Nov"

,

"Dec" 107  "January"

,

"February"

,

"March"

,

"April"

,

"May"

,

"June"

,

108  "July"

,

"August"

,

"September"

,

"October"

,

"November"

,

"December" 113  "Sun"

,

"Mon"

,

"Tue"

,

"Wed"

,

"Thu"

,

"Fri"

,

"Sat" 116  "Sunday"

,

"Monday"

,

"Tuesday"

,

"Wednesday"

,

117  "Thursday"

,

"Friday"

,

"Saturday" 142 #define CHECK_RANGE_EXCEPTION(value, what, min, max) \ 143  if ( value < min || value > max ) { \ 144  NCBI_THROW(CTimeException, eArgument, \ 146

NStr::Int8ToString((Int8)value) + "' is out of range"); \

149 #define CHECK_RANGE2(value, what, min, max, err_action) \ 150  if ( value < min || value > max ) { \ 151  if ( err_action == eErr_Throw ) { \ 152  NCBI_THROW(CTimeException, eArgument, \ 154

NStr::Int8ToString((Int8)value) + "' is out of range"); \

155

} else { return false; } \

158 #define CHECK_RANGE_YEAR(value) CHECK_RANGE_EXCEPTION(value, "Year"

, 1583, kMax_Int)

159 #define CHECK_RANGE_MONTH(value) CHECK_RANGE_EXCEPTION(value, "Month"

, 1, 12)

160 #define CHECK_RANGE_DAY(value) CHECK_RANGE_EXCEPTION(value, "Day"

, 1, 31)

161 #define CHECK_RANGE_HOUR(value) CHECK_RANGE_EXCEPTION(value, "Hour"

, 0, 23)

162 #define CHECK_RANGE_MIN(value) CHECK_RANGE_EXCEPTION(value, "Minute"

, 0, 59)

163 #define CHECK_RANGE_SEC(value) CHECK_RANGE_EXCEPTION(value, "Second"

, 0, 61)

164 #define CHECK_RANGE_NSEC(value) CHECK_RANGE_EXCEPTION(value, "Nanosecond"

, 0, kNanoSecondsPerSecond - 1)

166 #define CHECK_RANGE2_YEAR(value, err) CHECK_RANGE2(value, "Year"

, 1583, kMax_Int, err)

167 #define CHECK_RANGE2_MONTH(value, err) CHECK_RANGE2(value, "Month"

, 1, 12, err)

168 #define CHECK_RANGE2_DAY(value, err) CHECK_RANGE2(value, "Day"

, 1, 31, err)

169 #define CHECK_RANGE2_HOUR24(value, err) CHECK_RANGE2(value, "Hour"

, 0, 23, err)

170 #define CHECK_RANGE2_HOUR12(value, err) CHECK_RANGE2(value, "Hour"

, 0, 12, err)

171 #define CHECK_RANGE2_MIN(value, err) CHECK_RANGE2(value, "Minute"

, 0, 59, err)

172 #define CHECK_RANGE2_SEC(value, err) CHECK_RANGE2(value, "Second"

, 0, 61, err)

173 #define CHECK_RANGE2_NSEC(value, err) CHECK_RANGE2(value, "Nanosecond"

, 0, kNanoSecondsPerSecond - 1, err)

177 #define SET_YEAR(value) m_Data.year = static_cast<unsigned int>((value) & 0xFFF) 178 #define SET_MONTH(value) m_Data.month = static_cast<unsigned char>((value) & 0x0F) 179 #define SET_DAY(value) m_Data.day = static_cast<unsigned char>((value) & 0x1F) 180 #define SET_HOUR(value) m_Data.hour = static_cast<unsigned char>((value) & 0x1F) 181 #define SET_MIN(value) m_Data.min = static_cast<unsigned char>((value) & 0x3F) 182 #define SET_SEC(value) m_Data.sec = static_cast<unsigned char>((value) & 0x3F) 194  unsigned

d = date.

Day

();

195  unsigned

m = date.

Month

();

196  unsigned

y = date.

Year

();

208  return

((146097 * c) >> 2) + ((1461 * ya) >> 2) +

209

(153 * m + 2) / 5 + d + 1721119;

218  unsigned

j = num - 1721119;

223

year = (((j<<2) - 1) / 146097);

224

j = (j<<2) - 1 - 146097 * year;

226

j = ((d<<2) + 3) / 1461;

227

d = (d<<2) + 3 - 1461 * j;

229

month = (5*d - 3) / 153;

230

d = 5*d - 3 - 153 * month;

232

year = 100 * year + j;

242  CTime

(year, month, day,

t

.Hour(),

t

.Minute(),

t

.Second(),

243  t

.NanoSecond(),

t

.GetTimeZone(),

t

.GetTimeZonePrecision());

271  buf

[--pos] = char((

value

% 10) +

'0'

);

286  const size_t size

= 9;

292  buf

[--pos] = char((

value

% 10) +

'0'

);

300  if

(ignore_trailing_zeros) {

301  for

(;

len

> 1 && p[

len

-1] ==

'0'

; --

len

) {}

313  buf

[1] = char((

value

% 10) +

'0'

);

314  buf

[0] = char((

value

/ 10) +

'0'

);

359  "Incompatible flags specified together: fFormat_Simple | fFormat_Ncbi"

);

367  "Incompatible flags specified together: fMatch_Strict | fMatch_Weak"

);

380  if

( &fmt ==

this

) {

392  static const char

* s_Predefined[][2] =

396

{

"Y-M-D"

,

"$Y-$M-$D"

},

397

{

"Y-M-DTh:m"

,

"$Y-$M-$DT$h:$m"

},

398

{

"Y-M-DTh:m:s"

,

"$Y-$M-$DT$h:$m:$s"

},

399

{

"Y-M-DTh:m:G"

,

"$Y-$M-$DT$h:$m:$G"

},

444  t

.AddDay(yearDayNumber - 1);

452 #define X_INIT_ERROR(type, msg) \ 453  if (err_action == eErr_Throw) { \ 454  NCBI_THROW(CTimeException, type, msg); \ 460 #define SKIP_SPACES(s) \ 461  while (isspace((unsigned char)(*s))) ++s; 473  bool str

(

const char

*& s) {

476  if

(*s !=

':'

)

return false

;

513  if

(

str

.empty() ) {

523  bool

is_year_present =

false

;

524  bool

is_month_present =

false

;

525  bool

is_day_present =

false

;

526  bool

is_time_present =

false

;

528  const string

& fmt =

format

.GetString();

530  bool

is_escaped_symbol =

false

;

533  const char

* sss =

str

.c_str();

534  bool

adjust_needed =

false

;

540

EHourFormat hour_format = e24;

542  bool

is_12hour =

false

;

546  bool

is_format_space =

false

;

549  for

(fff = fmt.c_str(); *fff !=

'\0'

; ++fff) {

553  if

(!is_escaped_symbol) {

555  if

(

isspace

((

unsigned char

)(*fff))) {

556

is_format_space =

true

;

559  if

(is_ignore_spaces) {

564  if

(

isspace

((

unsigned char

)(*sss))) {

565  if

(is_format_space) {

572  if

(is_format_space) {

576

is_format_space =

false

;

581  if

(is_escaped_fmt && !is_escaped_symbol) {

583

is_escaped_symbol =

true

;

590  if

(is_escaped_fmt) {

600

is_escaped_symbol =

false

;

617  if

(*fff ==

'b'

|| *fff ==

'B'

) {

624  for

(

unsigned char i

= 0;

i

< 12; ++

i

) {

625  size_t

namelen = strlen(*name);

633

is_month_present =

true

;

638  if

(*fff ==

'w'

|| *fff ==

'W'

) {

640  for

(

unsigned char i

= 0;

i

< 7; ++

i

) {

641  size_t len

= strlen(*day);

658

sss += ((*sss ==

'Z'

) ? 1 : 3);

666  if

(*fff ==

'z'

|| tz_fmt_check.

fmt

(fff)) {

673  int

sign = (*sss ==

'+'

) ? 1 : ((*sss ==

'-'

) ? -1 : 0);

683  char

* s = value_str;

684  for

(

size_t len

= 2;

685  len

&& *sss &&

isdigit

((

unsigned char

)(*sss));

697  if

( *sss !=

'\0'

) {

698  if

(!tz_fmt_check.

str

(sss)) {

702  for

(

size_t len

= 2;

703  len

&& *sss &&

isdigit

((

unsigned char

)(*sss));

715

adjust_needed =

true

;

716

adjust_tz = sign * (x_hour * 60 + x_min) * 60;

721  if

(*fff ==

'p'

|| *fff ==

'P'

) {

734  char

* s = value_str;

737  case 'Y'

:

len

= 4;

break

;

738  case 'S'

:

len

= 9;

break

;

739  case 'l'

:

len

= 3;

break

;

740  case 'r'

:

len

= 6;

break

;

742  for

( ;

len

&& *sss &&

isdigit

((

unsigned char

)(*sss)); --

len

) {

753

is_year_present =

true

;

763

is_year_present =

true

;

768

is_month_present =

true

;

774

is_day_present =

true

;

779

is_time_present =

true

;

785

is_time_present =

true

;

790

is_time_present =

true

;

795

is_time_present =

true

;

800

is_time_present =

true

;

805

is_time_present =

true

;

810

is_time_present =

true

;

822  n

&& *sss &&

isdigit

((

unsigned char

)(*sss)); --

n

) {

827  size_t n

= strlen(value_str);

830  for

(;

n

< 9; ++

n

) {

836  while

(

isdigit

((

unsigned char

)(*sss)) ) {

840

is_time_present =

true

;

844  X_INIT_ERROR

(eFormat,

"Format '"

+ fmt +

"' has incorrect format symbol '"

+ *fff +

"'"

);

849  if

(is_12hour && hour_format == ePM) {

854  if

(is_ignore_spaces) {

857  if

(

isspace

((

unsigned char

)(*sss)) && is_format_space) {

866  "' is too short for time format '"

+ fmt +

"'"

);

871  "' is too long for time format '"

+ fmt +

"'"

);

873  if

(*fff !=

'\0'

&& *sss !=

'\0'

&&

876  "' does not match time format '"

+ fmt +

"'"

);

881

ptcache += (is_year_present ? 2000 : 1000);

882

ptcache += (is_month_present ? 200 : 100);

883

ptcache += (is_day_present ? 20 : 10);

884

ptcache += (is_time_present ? 2 : 1);

888  if

( !adjust_needed ) {

928  if

(weekday != -1 && weekday !=

DayOfWeek

()) {

933  X_INIT_ERROR

(eConvert,

"Unable to convert string '"

+

str

+

"' to CTime"

);

936  if

( adjust_needed ) {

953  int

minute,

int

second,

long

nanosecond,

980  string

(

"Invalid time "

) +

s_TimeDump

(*

this

));

1051  "Unable to set year number '"

+

1068  "Unable to set month number '"

+

1078  if

( day > n_days ) {

1086  "Unable to set day number '"

+

1150  "Day of week with value "

+

1159

wday -= first_day_of_week;

1167

week_num = yday / 7;

1168  if

( (yday % 7) >= wday ) {

1173  return

week_num + 1;

1180  int

week_num_first = first_of_month.

YearWeekNumber

(first_day_of_week);

1182  return

week_num_current - week_num_first + 1;

1195  return

(y + y/4 - y/100 + y/400 +

"-bed=pen+mad."

[m] +

Day

()) % 7;

1206

n_days =

IsLeap

() ? 29 : 28;

1215  for

(

int i

= 0;

i

< 12; ++

i

) {

1224  "Invalid month name '"

+ month +

"'"

);

1232  if

(month < 1 || month > 12) {

1244  for

(

int i

= 0;

i

<= 6; ++

i

) {

1253  "Invalid day of week name '"

+ day +

"'"

);

1261  if

(day < 0 || day > 6) {

1273  s_TlsFormatTime

.SetValue(ptr, CTlsBase::DefaultCleanup<CTimeFormat>);

1296 #if defined(HAVE_TIMEGM) || defined(NCBI_OS_DARWIN) 1297  t

.tm_sec =

ct

.Second();

1300  t

.tm_sec =

ct

.Second() + (

int

)(

ct

.IsUniversalTime() ? -

TimeZone

() : 0);

1302  t

.tm_min =

ct

.Minute();

1303  t

.tm_hour =

ct

.Hour();

1304  t

.tm_mday =

ct

.Day();

1305  t

.tm_mon =

ct

.Month()-1;

1306  t

.tm_year =

ct

.Year()-1900;

1308 #if defined(NCBI_OS_DARWIN) 1309

time_t tt = mktime(&

t

);

1310  if

( tt == (time_t)(-1L) ) {

1313  return ct

.IsUniversalTime() ? tt+

t

.tm_gmtoff : tt;

1314 #elif defined(HAVE_TIMEGM) 1315  return ct

.IsUniversalTime() ? timegm(&

t

) : mktime(&

t

);

1319

timer = mktime(&

t

);

1320  if

( timer == (time_t)(-1L) ) {

1325  if

(

ct

.IsUniversalTime() ) {

1335  t

.tm_min =

ct

.Minute();

1336  t

.tm_hour =

ct

.Hour();

1337  t

.tm_mday =

ct

.Day();

1338  t

.tm_mon =

ct

.Month()-1;

1339  t

.tm_year =

ct

.Year()-1900;

1341

timer = mktime(&

t

);

1342  if

( timer == (time_t)(-1L) ) {

1346 # if defined(HAVE_LOCALTIME_R) 1348

localtime_r(&timer, &temp);

1351

ttemp = localtime(&timer);

1354  return

(time_t)(-1L);

1355  if

(ttemp->tm_isdst > 0 &&

Daylight

())

1367  if

(timer == (time_t)(-1L)) {

1371 # if defined(HAVE_LOCALTIME_R) 1373

localtime_r(&timer, &temp);

1376  t

= localtime(&timer);

1381  return

(

t

->tm_isdst > 0);

1411  t

.tm_sec =

lt

.Second();

1412  t

.tm_min =

lt

.Minute();

1413  t

.tm_hour =

lt

.Hour();

1414  t

.tm_mday =

lt

.Day();

1415  t

.tm_mon =

lt

.Month()-1;

1416  t

.tm_year =

lt

.Year()-1900;

1417  t

.tm_wday =

lt

.DayOfWeek();

1462

dbt.

time

= (

Uint2

)(

t

.Hour() * 60 +

t

.Minute());

1475

dbt.

time

= (

Int4

)((

t

.Hour() * 3600 +

t

.Minute() * 60 +

t

.Second()) * 300 +

1526  if

(

format

.IsEmpty() ) {

1528

fmt =

f

.GetString();

1529

fmt_flags =

f

.GetFlags();

1531

fmt =

format

.GetString();

1532

fmt_flags =

format

.GetFlags();

1535  bool

is_format_symbol = !is_escaped;

1544 #if defined(NCBI_TIMEZONE_IS_UNDEFINED) 1546  ERR_POST_X

(4,

"Output timezone is unsupported on this platform"

);

1550  TSeconds

x_timezone = 0, x_dstbias = 0;

1551  bool

x_isdst =

false

;

1561

t_out =

new CTime

(*

this

);

1579  if

( !is_format_symbol ) {

1581

is_format_symbol =

true

;

1588

is_format_symbol =

false

;

1616  case 'p'

:

str

+= (

t

->Hour() < 12) ?

"am"

:

"pm"

;

break

;

1617  case 'P'

:

str

+= (

t

->Hour() < 12) ?

"AM"

:

"PM"

;

break

;

1618  case 'o'

: tz_fmt_make.

activate

();

1620 #if defined(NCBI_TIMEZONE_IS_UNDEFINED) 1621  ERR_POST_X

(5,

"Format symbol 'z' is unsupported " 1622  "on this platform"

);

1624  if

(!tz_fmt_make.

active

()) {

1637  str

+= (tz > 0) ?

'-'

:

'+'

;

1638  if

(tz < 0) tz = -tz;

1641

tz_fmt_make.

str

(

str

);

1652

default :

str

+= *it;

break

;

1676 #if defined(NCBI_OS_MSWIN) 1680

GetSystemTimeAsFileTime(&systime);

1682

systemp = systime.dwHighDateTime;

1684

systemp |= systime.dwLowDateTime;

1686

ns = (systemp % 10000000) * 100;

1687 #elif defined(NCBI_OS_UNIX) 1693

*sec = (time_t)(-1L);

1700  if

(*sec == (time_t)(-1L)) {

1702  "Unable to get time value"

);

1725 #ifdef HAVE_LOCALTIME_R 1728

localtime_r(&timer, &temp);

1730

gmtime_r(&timer, &temp);

1738  "localtime/gmtime error, possible incorrect time_t value"

);

1766  bool

aflag =

false

;

1768

pt =

new CTime

(*

this

);

1774  long

newMonth =

Month

() - 1;

1775  int

newYear =

Year

();

1797  bool

aflag =

false

;

1799

pt =

new CTime

(*

this

);

1829  bool

aflag =

false

;

1831

pt =

new CTime

(*

this

);

1838  long

newHour =

Hour

();

1839  s_Offset

(&newHour, hours, 24, &dayOffset);

1859  bool

aflag =

false

;

1861

pt =

new CTime

(*

this

);

1868  long

newMinute =

Minute

();

1869  s_Offset

(&newMinute, minutes, 60, &hourOffset);

1888  int

minuteOffset = 0;

1889  long

newSecond =

Second

();

1890  s_Offset

(&newSecond, seconds, 60, &minuteOffset);

1904  int

secondOffset = 0;

1949

/ 1000000 * 1000000;

1958  "Rounding precision is out of range"

);

2023  if

(

Year

() < 1583)

2027  if

(

Month

() == 2) {

2057  return t

.ToLocalTime();

2070  return t

.ToUniversalTime();

2083  if

(timer == (time_t)(-1L)) {

2089 #if defined(HAVE_LOCALTIME_R) 2092

localtime_r(&timer, &temp);

2095

gmtime_r(&timer, &temp);

2099  t

= (tz ==

eLocal

) ? localtime(&timer) : gmtime(&timer);

2103  "localtime/gmtime error, possible incorrect time_t value"

);

2123  if

( !

tmp

.IsEmptyDate() ) {

2140  if

( !

tmp

.IsEmptyDate() ) {

2151  if

(

Day

() >

tmp

.Day())

2153  if

(

Day

() <

tmp

.Day())

2177  if

( !

tmp

.IsEmptyDate() ) {

2188  if

(

Day

() <

tmp

.Day())

2190  if

(

Day

() >

tmp

.Day())

2214  return

(year % 4 == 0 && year % 100 != 0) || year % 400 == 0;

2227  return

((dDays * 24 + dHours) * 60 + dMins) * 60 + dSecs;

2251  if

(timer == (time_t)(-1L)) {

2258 #if defined(HAVE_LOCALTIME_R) 2260

localtime_r(&timer, &temp);

2263  t

= localtime(&timer);

2268 #if defined(__USE_BSD) 2284  const CTime

* p1, *p2;

2301  return

((dDays * 24 + dHours) * 60 + dMins) * 60 + dSecs;

2308  if

(sec < kMin_Long || sec > kMax_Long) {

2310  "Difference in time "

+

2312  " is too big to convert to CTimeSpan"

);

2320  if

(seconds < (

double

)kMin_Long || seconds > (

double

)kMax_Long) {

2323  " is too big to convert to CTimeSpan"

);

2325  m_Sec

= long(seconds);

2334  if

(

Day

() > n_days) {

2353  if

(

Day

() != from.

Day

())

2370  const int

kShiftHours = 4;

2381

sign = ( *

this

> from ) ? 1 : -1;

2399  CTime

tn(

t

+ (time_t)diff + 3600 * kShiftHours * sign);

2432  if

(sec < kMin_Long || seconds > kMax_Long) {

2439  ", nanosec) is too big to convert to CTimeSpan"

);

2483  if

(

str

.empty() ) {

2486  const string

& fmt =

format

.GetString();

2488  bool

is_escaped_symbol =

false

;

2492  const char

* sss =

str

.c_str();

2495  for

(fff = fmt.c_str(); *fff !=

'\0'

; ++fff) {

2498  if

(is_escaped_fmt && !is_escaped_symbol) {

2500

is_escaped_symbol =

true

;

2507  if

(is_escaped_fmt) {

2517

is_escaped_symbol =

false

;

2547  char

* s = value_str;

2549  size_t len

= (

f

==

'\1'

) ? 9 : 10;

2550  for

(;

len

&& *sss &&

isdigit

((

unsigned char

)(*sss)); --

len

) {

2583  if

( *sss ==

'.'

) {

2587  goto

read_next_value;

2592  if

( *sss ==

'.'

) {

2596  goto

read_next_value;

2604  size_t n

= strlen(value_str);

2607  for

(;

n

< 9; ++

n

) {

2613  while

(

isdigit

((

unsigned char

)(*sss)) ) {

2627  "Time string '"

+

str

+

2628  "' is too short for time format '"

+ fmt +

"'"

);

2633  "Time string '"

+

str

+

2634  "' is too long for time format '"

+ fmt +

"'"

);

2652

}

else if

(m_Sec < 0 && m_NanoSec > 0) {

2664  s_TlsFormatSpan

.SetValue(ptr, CTlsBase::DefaultCleanup<CTimeFormat>);

2688  if

(

format

.IsEmpty() ) {

2690

fmt =

f

.GetString();

2691

fmt_flags =

f

.GetFlags();

2693

fmt =

format

.GetString();

2694

fmt_flags =

format

.GetFlags();

2697  bool

is_format_symbol = !is_escaped;

2701  if

( !is_format_symbol ) {

2703

is_format_symbol =

true

;

2710

is_format_symbol =

false

;

2741

default :

str

+= *it;

2781

{

"millisecond"

,

"ms"

},

2782

{

"microsecond"

,

"us"

},

2783

{

"nanosecond"

,

"ns"

}

2820  for

(adjust_level =

eYear

; adjust_level <

eSecond

; adjust_level++) {

2829  switch

(

EUnit

(adjust_level) ) {

2851  const int

max_count = 6;

2852  long

span[max_count];

2857

span[

eDay

] = sec/(3600L*24); sec %= (3600L*24);

2858

span[

eHour

] = sec/3600L; sec %= 3600L;

2859

span[

eMinute

] = sec/60L; sec %= 60L;

2867  for

(; start < 5; ++start) {

2868  if

( span[start] ) {

2880  while

(start <= prec) {

2881  long val

= span[start];

2886  if

( !

result

.empty() ) {

2918  int

milli =

int

(nanoseconds / 1000000);

2919  int

micro =

int

(nanoseconds / 1000 % 1000);

2920  int

nano =

int

(nanoseconds % 1000);

2931

}

else if

( milli ) {

2935

}

else if

( micro ) {

2939

}

else if

( nano ) {

2949  bool

plural = (v1 != 1);

2957

}

else if

(

len

== 2) {

2975

unit =

EUnit

(unit-1);

2986  if

(

v2

&&

len

< 3) {

3033  if

( !is_named_precision ) {

3037  for

(adjust_level =

eYear

; adjust_level <=

eSecond

; adjust_level++) {

3043  if

(adjust_level <=

eSecond

) {

3059  switch

(

EUnit

(adjust_level) ) {

3096

SItem(

long

v,

EUnit

u) :

value

(v), unit(u) {};

3100  const int

max_count = 7;

3101

SItem span[max_count];

3105

span[2] = SItem(sec/(3600L*24),

eDay

); sec %= (3600L*24);

3106

span[3] = SItem(sec/3600L,

eHour

); sec %= 3600L;

3107

span[4] = SItem(sec/60L,

eMinute

); sec %= 60L;

3108

span[5] = SItem(sec,

eSecond

);

3131  for

(

int i

= 0;

i

< max_count && start <=

precision

; ++

i

) {

3132  long val

= span[

i

].value;

3140  if

( is_named_precision ) {

3151  for

(

int

j =

i

+ 1;

3152

j < max_count && (cp <=

precision

); ++j, ++cp) {

3153

sum += span[j].value;

3162  if

( !

result

.empty() ) {

3194  "Negative CTimeSpan cannot be converted to smart string"

);

3208  const string

kMsg =

"Incompatible flags specified together: "

;

3214  if

( !(

f

&& !(

f

& (

f

-1))) ) {

3226  if

((

flags

&

f

) == 0) {

3238  if

((

flags

&

f

) == 0) {

3246  if

((

flags

&

f

) == 0) {

3266  if

(

str

.empty() ) {

3270  const char

* sss =

str

.c_str();

3271  bool

numeric_expected =

true

;

3274  size_t

frac_len = 0;

3277

memset(repetitions, 0,

kUnitCount

*

sizeof

(repetitions[0]));

3279  for

(; *sss !=

'\0'

; ++sss) {

3282  if

(

isspace

((

unsigned char

)(*sss))) {

3287  if

(numeric_expected) {

3289  value

= 0; frac = 0;

3291  if

(

isdigit

((

unsigned char

)(*sss))) {

3293  const char

* start = sss++;

3294  while

(*sss &&

isdigit

((

unsigned char

)(*sss))) ++sss;

3295  size_t n

= sss - start;

3298  "Too long numeric value '"

+

string

(start,

n

) +

3299  "': string '"

+

str

+

"' (pos = "

+

3312  if

(*sss &&

isdigit

((

unsigned char

)(*sss))) {

3313  const char

* start = sss++;

3314  while

(*sss &&

isdigit

((

unsigned char

)(*sss))) ++sss;

3315

frac_len = sss - start;

3318  "Too long fractional part '"

+

string

(start, frac_len) +

3319  "': string '"

+

str

+

"' (pos = "

+

3327

numeric_expected =

false

;

3333  if

(!

isalpha

((

unsigned char

)(*sss))) {

3336  const char

* start = sss++;

3337  while

(*sss &&

isalpha

((

unsigned char

)(*sss))) ++sss;

3338  size_t n

= sss - start;

3340  string

spec(start,

n

);

3346

spec ==

kUnitNames

[

i

].name_full +

string

(

"s"

) ||

3353  "Unknown time specifier '"

+ spec +

"': string '"

+

str

+

3385  unsigned int

div = 10;

3387  while

(--frac_len) div *= 10;

3399  if

(((

TSeconds

)frac * 10 / div) >=5 ) {

3409  if

(repetitions[

i

]) {

3411  "Time component for '"

+

string

(

kUnitNames

[

i

].name_full) +

3412  "s' already exists: string '"

+

str

+

3415

repetitions[

i

] =

true

;

3424  if

( sec <= kMin_Long || sec >= kMax_Long ||

3425

ns <= kMin_Long || ns >= kMax_Long) {

3427  "Value is too big to convert to CTimeSpan: string '"

+

str

+

3432

numeric_expected =

true

;

3437  if

(!numeric_expected) {

3439  "Time specifier expected: string '"

+

str

+

3442  if

(*sss !=

'\0'

) {

3444  "Unexpected symbol: string '"

+

str

+

3468  return "eInfinity"

;

3481  "IsZero() cannot be used with "

+

3494  "Cannot convert from "

+

3497 #if (SIZEOF_INT == SIZEOF_LONG) 3504  " too big to convert to unsigned long"

);

3516  "Cannot convert from "

+

3527  "Cannot convert from "

+

3530 #if (SIZEOF_INT == SIZEOF_LONG) 3531  if

(

m_Sec

> (

unsigned int

) kMax_Long ) {

3535  " too big to convert to CTimeSpan"

);

3549  "Cannot convert from "

+

3565  "Cannot convert from "

+

3616  "Cannot set negative value "

+

3634  "Cannot convert from negative CTimeSpan("

+

3639  "CTimeSpan value ("

+

3651 #define COMPARE_TIMEOUT_TYPES(t1, t2) ((int(t1) << 2) | int(t2)) 3666  "Unable to compare with "

+

3684  "Unable to compare with "

+

3702  "Unable to compare with "

+

3725  "Unable to compare with "

+

3748  "Unable to compare with "

+

3762

: m_Seconds(0), m_Nanoseconds(0), m_Infinite(

type

== eInfinite)

3768

: m_Seconds(0), m_Nanoseconds(0), m_Infinite(

false

)

3771  if

(seconds || nanoseconds) {

3778

: m_Seconds(0), m_Nanoseconds(0), m_Infinite(

false

)

3783  else if

(timeout.

IsZero

()) {

3787  unsigned int

sec, usec;

3788

timeout.

Get

(&sec, &usec);

3799 #if defined(NCBI_OS_MSWIN) 3803

GetSystemTimeAsFileTime(&systime);

3805

systemp = systime.dwHighDateTime;

3807

systemp |= systime.dwLowDateTime;

3812  struct

timespec timebuffer;

3813  if

(clock_gettime(CLOCK_REALTIME, &timebuffer) == 0) {

3818  "Cannot get current deadline time value"

);

3828  "Cannot get current deadline time value"

);

3833  if

(seconds || nanoseconds) {

3846  "Cannot convert from "

+

3848  " deadline value"

);

3863  "Cannot convert from "

+

3865  " deadline value"

);

3884  if

(thenS < nowS || (thenS == nowS && thenNS <= nowNS)) {

3887  if

(thenNS >= nowNS) {

3910  "Cannot compare two "

+

3912  " deadline values"

);

3926

: m_SecAfterHour(sec_after_hour),

3927

m_LastTuneupTime(0), m_LastSysTime(0),

3928

m_Timezone(0), m_IsTuneup(

NULL

)

3930 #if !defined(NCBI_TIMEZONE_IS_UNDEFINED) 3968 #if !defined(NCBI_TIMEZONE_IS_UNDEFINED) 4001 #if !defined(NCBI_TIMEZONE_IS_UNDEFINED) 4015

#

if

!defined(NCBI_TIMEZONE_IS_UNDEFINED)

4025

LOCK.

Guard

(s_FastLocalTimeMutex);

4045 #if !defined(NCBI_TIMEZONE_IS_UNDEFINED) 4097 #if defined(NCBI_OS_MSWIN) 4100

LARGE_INTEGER bigint;

4102  static bool first

=

true

;

4105

LARGE_INTEGER nfreq;

4106

QueryPerformanceFrequency(&nfreq);

4107

freq = double(nfreq.QuadPart);

4111  if

( !QueryPerformanceCounter(&bigint) ) {

4114  return

double(bigint.QuadPart) / freq;

4118  struct

timeval time;

4122  return

double(time.tv_sec) + double(time.tv_usec) / 1e6;

4182  case eConvert

:

return "eConvert"

;

4183  case eInvalid

:

return "eInvalid"

;

4184  case eFormat

:

return "eFormat"

;

void Guard(resource_type &resource)

Manually force the guard to protect some other resource.

void Release()

Manually force the resource to be released.

CNanoTimeout – Timeout interval, using nanoseconds.

CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...

CTimeout – Timeout interval.

std::ofstream out("events_result.xml")

main entry point for tests

static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)

static const char * str(char *buf, int n)

#define ITERATE(Type, Var, Cont)

ITERATE macro to sequence through container elements.

@ eNegative

Value is negative.

#define ERR_POST_X(err_subcode, message)

Error posting with default error code and given error subcode.

#define NCBI_THROW(exception_class, err_code, message)

Generic macro to throw an exception, given the exception class, error code and message string.

TErrCode GetErrCode(void) const

virtual const char * GetErrCodeString(void) const

Get error code interpreted as text.

int32_t Int4

4-byte (32-bit) signed integer

uint16_t Uint2

2-byte (16-bit) unsigned integer

int64_t Int8

8-byte (64-bit) signed integer

uint64_t Uint8

8-byte (64-bit) unsigned integer

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

static string Int8ToString(Int8 value, TNumToStringFlags flags=0, int base=10)

Convert Int8 to string.

static string DoubleToString(double value, int precision=-1, TNumToStringFlags flags=0)

Convert double to string.

static int CompareNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)

Case-insensitive compare of a substring with another string.

static string LongToString(long value, TNumToStringFlags flags=0, int base=10)

Convert Int to string.

static int strncasecmp(const char *s1, const char *s2, size_t n)

Case-insensitive comparison of two zero-terminated strings, narrowed to the specified number of chara...

static string IntToString(int value, TNumToStringFlags flags=0, int base=10)

Convert int to string.

static unsigned long StringToULong(const CTempString str, TStringToNumFlags flags=0, int base=10)

Convert string to unsigned long.

static long StringToLong(const CTempString str, TStringToNumFlags flags=0, int base=10)

Convert string to long.

static string UIntToString(unsigned int value, TNumToStringFlags flags=0, int base=10)

Convert UInt to string.

static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)

Convert numeric value to string.

static string & ToLower(string &str)

Convert string to lower case – string& version.

@ fAllowTrailingSymbols

Ignore trailing non-numerics characters.

#define NCBI_SCHED_YIELD()

Int8 TSeconds

Number of seconds.

unsigned int TFlags

Binary OR of "EFlags".

CFastLocalTime(unsigned int sec_after_hour=5)

Constructor.

bool x_Init(const string &str, const CTimeFormat &fmt, EErrAction err_action=eErr_Throw)

Helper method to set time value from string "str" using format "fmt".

double m_Total

Accumulated elapsed time.

int Minute(void) const

Get minute.

static string DayOfWeekNumToName(int day, ENameFormat format=eFull)

Get name of the day of week by numerical value.

CTime & Truncate(ERoundPrecision precision=eRound_Day)

Truncate time.

string TimeZoneOffsetStr(void)

Get time zone offset string in format [+/-]HHMM.

int x_Second(void) const

Get second.

void SetMinute(int minute)

Set minute.

ETimeZonePrecision GetTimeZonePrecision(void) const

Get time zone precision.

CTime & ToLocalTime(void)

Convert the time into local time.

CTime(EInitMode mode=eEmpty, ETimeZone tz=eLocal, ETimeZonePrecision tzp=eTZPrecisionDefault)

Constructor.

TSeconds TimeZoneOffset(void) const

Get difference between local timezone for current time object and UTC in seconds.

void SetMonth(int month)

Set month.

EInitMode

Which initial value to use for time.

unsigned int TSmartStringFlags

Binary OR of "ESmartStringFlags".

CTimeSpan & operator=(const CTimeSpan &t)

Assignment operator.

void SetSecond(int second)

Set second.

EDayOfWeek

Day of week names.

int DayOfWeek(void) const

Get day of week.

CNanoTimeout GetRemainingTime(void) const

Get time left to the expiration.

Int4 days

days from 1/1/1900

static void SetFormat(const CTimeFormat &fmt)

Set the current time format.

CTime & AddTimeSpan(const CTimeSpan &timespan)

Add specified time span.

double Elapsed(void) const

Return time elapsed since first Start() or last Restart() call (in seconds).

static void SetFormat(const CTimeFormat &format)

Set the current time span format.

EErrAction

Defines how to behave on error.

CTime & x_AddHour(int hours=1, EDaylight daylight=eDaylightDefault, bool shift_time=true)

Helper method to add hour with/without shift time.

void SetMicroSecond(long microsecond)

Set microseconds.

TData m_Data

Packed members.

bool operator>(const CTime &t) const

Operator to test if time is later.

bool IsUniversalTime(void) const

Is time universal (GMT/UTC/Z)?

ETimeZone

Which initial value to use for timezone.

CTime & SetTimeDBI(const TDBTimeI &t)

Set time using database format time, TDBTimeI.

CTime & AddNanoSecond(long nanoseconds=1)

Add specified nanoseconds.

void SetFormat(const char *fmt, TFlags flags=fDefault)

Set the current time format.

CTime & Round(ERoundPrecision precision=eRound_Day, EDaylight adl=eDaylightDefault)

Round time.

long GetCompleteMinutes(void) const

Get number of complete minutes.

bool x_Tuneup(time_t timer, long nanosec)

Internal version of Tuneup()

CTimeSpan GetAsTimeSpan(void) const

Convert to CTimeSpan.

void x_Normalize(void)

Helper method to normalize stored time value.

CTime & AddSecond(TSeconds seconds=1, EDaylight adl=eDaylightDefault)

Add specified seconds.

long GetCompleteDays(void) const

Get number of complete days.

ETimeZone GetTimeZone(void) const

Get time zone.

int m_Timezone

Cached timezone adjustment for local time.

bool x_NeedAdjustTime(void) const

Helper method to check if there is a need adjust time in timezone.

long GetNanoSecondsAfterSecond(void) const

Get number of nanoseconds.

CTime & x_AdjustTime(const CTime &from, bool shift_time=true)

Helper method to adjust the time to correct timezone (across the barrier of winter & summer times) us...

void Set(long seconds, long nanoseconds=0)

Set time span in seconds and nanoseconds.

int DiffWholeDays(const CTime &t) const

Difference in whole days from specified time.

EDaylight

Whether to adjust for daylight saving time.

CTime GetUniversalTime(void) const

Get the time as universal (GMT/UTC) time.

int MonthWeekNumber(EDayOfWeek first_day_of_week=eSunday) const

Get this date's week number in the month.

ETimeZonePrecision SetTimeZonePrecision(ETimeZonePrecision val)

Set time zone precision.

CTime m_TunedTime

Last tuned time (changed by Tuneup())

CTime & AddMonth(int months=1, EDaylight adl=eDaylightDefault)

Add specified months and adjust for daylight saving time.

CTime & Clear(void)

Make the time "empty",.

long NanoSecond(void) const

Get nano-seconds.

void SetYear(int year)

Set year.

unsigned int m_SecAfterHour

Time interval in seconds after hour.

int Year(void) const

Get year.

void SetMilliSecond(long millisecond)

Set milliseconds.

string AsString(const CTimeFormat &format=kEmptyStr, TSeconds out_tz=eCurrentTimeZone) const

Transform time to string.

int YearWeekNumber(EDayOfWeek first_day_of_week=eSunday) const

Get this date's week number within the year.

string x_AsSmartString_Precision(TSmartStringFlags flags) const

void x_Init(const string &str, const CTimeFormat &fmt)

Helper method to set time value from string "str" using format "fmt".

string x_AsSmartString_Smart_Small(TSmartStringFlags flags) const

const long kMilliSecondsPerSecond

Number milliseconds in one second.

void SetHour(int hour)

Set hour.

CTime & ToTime(ETimeZone val)

Convert the time into specified time zone time.

time_t m_LastSysTime

Last system time.

bool IsEmpty(void) const

Is time object empty (date and time)?

bool operator<(const CTimeout &t) const

Operator to test if timeout is less.

double GetAsDouble(void) const

Get as number of seconds (fractional value).

TFlags m_Flags

Format flags.

bool operator<(const CTime &t) const

Operator to test if time is earlier.

CStopWatch(EStart state=eStop)

Constructor.

CTime & ToUniversalTime(void)

Convert the time into universal (GMT/UTC) time.

bool IsValid(void) const

Is time valid?

static CTimeFormat GetFormat(void)

Get the current time span format.

ESign GetSign(void) const

Get sign of time span.

string TimeZoneName(void)

Get current time zone name.

bool operator==(const CTimeout &t) const

Operator to test equality of timeouts.

void Invert(void)

Invert time span. Changes time span sign.

CTime & SetCurrent(void)

Make the time current in the presently active time zone.

void x_AdjustDay(void)

Helper method to adjust day number to correct value after day manipulations.

void Tuneup(void)

Do unscheduled check.

CTime & SetTimeDBU(const TDBTimeU &t)

Set time using database format time, TDBTimeU.

unsigned int m_Nanoseconds

CTimeSpan & AssignFromSmartString(const string &str)

Assign value to time span object from string representation of time in formats produced by AsSmartStr...

EPredefined

Predefined formats.

ETimeZonePrecision

What time zone precision to use for adjusting daylight saving time.

CTime & x_SetTime(const time_t *t=0)

Helper method to set time from 'time_t' – If "t" not specified, then set to current time.

string AsSmartString(ESmartStringPrecision precision, ERound rounding, ESmartStringZeroMode zero_mode=eSSZ_SkipZero) const

Transform time span to "smart" string.

void SetNano(unsigned int sec, unsigned int nanosec)

Set timeout in seconds and nanoseconds.

static CTimeFormat GetFormat(void)

Get the current stopwatch time format.

static void SetFormat(const CTimeFormat &fmt)

Set the current stopwatch time format.

const TSeconds kAverageSecondsPerMonth

CTimeSpan DiffTimeSpan(const CTime &t) const

Difference in nanoseconds from specified time.

int DaysInMonth(void) const

Get number of days in the month.

bool operator<(const CDeadline &right_hand_operand) const

Compare two CDeadline values.

CDeadline(EType type=eNoWait)

Initialize deadline of specified type.

time_t GetTimeT(void) const

Get time in time_t format.

TDBTimeI GetTimeDBI(void) const

Get time in database format time, TDBTimeI.

unsigned int m_Sec

Seconds part of the timeout.

CTimeSpan(void)

Default constructor.

int GetLocalTimezone(void)

Get difference in seconds between UTC and current local time (daylight information included)

bool operator<=(const CTimeout &t) const

Operator to test if timeout is less or equal.

void SetDay(int day)

Set day.

ETimeZonePrecision tzprec

int Day(void) const

Get day.

void GetNano(unsigned int *sec, unsigned int *nanosec) const

Get timeout in seconds and nanoseconds.

unsigned long GetAsMilliSeconds(void) const

Get as number of milliseconds.

static double GetTimeMark()

Get current time mark.

TSeconds DiffSecond(const CTime &t) const

Difference in seconds from specified time.

TDBTimeU GetTimeDBU(void) const

Get time in database format time, TDBTimeU.

unsigned int m_NanoSec

Nanoseconds part of the timeout.

int x_Hour(void) const

Get hour.

Uint2 days

Days from 1/1/1900.

static CTimeFormat GetPredefined(EPredefined fmt, TFlags flags=fDefault)

Get predefined format.

void Start(void)

Start the timer.

static CTimeFormat GetFormat(void)

Get the current time format.

bool IsLeap(void) const

Is time in a leap year?

bool IsEmpty(void) const

Check that format string is empty.

CTime & SetTimeTM(const struct tm &t)

Set time using "struct tm" time value.

long m_NanoSec

Nanoseconds after the second.

string AsString(const CTimeFormat &fmt=kEmptyStr) const

Transform time span to string.

static int MonthNameToNum(const string &month)

Get numerical value of the month by name.

Uint2 time

Minutes from the beginning of current day.

Int4 time

x/300 seconds from the beginning of current day

CTime m_LocalTime

Current local time.

string AsString(const CTimeFormat &fmt=kEmptyStr) const

Transform stopwatch time to string.

void Set(EType type)

Set special value.

int m_Daylight

Cached system daylight information.

CTime GetFastLocalTime(void)

Quick and dirty getter of local time.

int x_Minute(void) const

Get minute.

void Get(unsigned int *sec, unsigned int *microsec) const

Get timeout in seconds and microseconds.

ERoundPrecision

Precision for rounding time.

CTime & x_AdjustTimeImmediately(const CTime &from, bool shift_time=true)

Helper method to forcibly adjust timezone using "from" as a reference point.

void SetNanoSecond(long nanosecond)

Set nanoseconds.

CTime & SetTimeT(const time_t t)

Set time using time_t time value.

virtual const char * GetErrCodeString(void) const override

Translate from the error code value to its string representation.

CTimeFormat(void)

Default constructor.

bool operator>=(const CTimeout &t) const

Operator to test if timeout is greater or equal.

int Hour(void) const

Get hour.

bool IsInfinite(void) const

Check if the deadline is infinite.

CTime & x_SetTimeMTSafe(const time_t *t=0)

Version of x_SetTime() with MT-safe locks.

bool IsFinite() const

Check if timeout holds a numeric value.

void TuneupFastLocalTime(void)

double m_Start

Start time value.

CTime GetLocalTime(void) const

Get the time as local time.

CTime GetLocalTime(void)

Get local time.

CTimeSpan & Clear(void)

Make the time span "empty",.

string m_Str

String format.

void x_SetNowPlus(unsigned int seconds, unsigned int nanoseconds)

CTime & AddDay(int days=1, EDaylight adl=eDaylightDefault)

Add specified days and adjust for daylight saving time.

CTimeFormat & operator=(const CTimeFormat &fmt)

Assignment operator.

EType

Type of special deadlines.

bool IsLocalTime(void) const

Is time local time?

const long kMicroSecondsPerSecond

Number of microseconds in one second.

long GetCompleteSeconds(void) const

Get number of complete seconds.

static string MonthNumToName(int month, ENameFormat format=eFull)

Get name of the month by numerical value.

EStart m_State

Stopwatch state (started/stopped)

CTime & AddHour(int hours=1, EDaylight adl=eDaylightDefault)

Add specified hours and adjust for daylight saving time.

bool IsDST(void) const

Is DST (daylight savings time) in effect for this time?

const TSeconds kAverageSecondsPerYear

The average length of the year in the Gregorian (modern) calendar (in seconds)

int Second(void) const

Get second.

int Month(void) const

Get month.

long GetCompleteHours(void) const

Get number of complete hours.

CTime & AddMinute(int minutes=1, EDaylight adl=eDaylightDefault)

Add specified minutes and adjust for daylight saving time.

void *volatile m_IsTuneup

(bool) Tuneup() in progress (MT)

static int DayOfWeekNameToNum(const string &day)

Get numerical value of the day of week by name.

const long kNanoSecondsPerSecond

Number of nanoseconds in one second.

EType m_Type

Type of timeout.

static void GetCurrentTimeT(time_t *sec, long *nanosec=0)

Get current UTC time in time_t format (with nanoseconds).

static bool ValidateString(const string &str, const CTimeFormat &fmt=kEmptyStr)

Validate if string match time format.

int YearDayNumber(void) const

Get year's day number.

ENameFormat

Which format use to get name of month or week of day.

time_t m_LastTuneupTime

Last Tuneup() time.

bool operator>(const CTimeout &t) const

Operator to test if timeout is greater.

bool operator==(const CTime &t) const

Operator to test equality of time.

long m_Sec

Seconds part of the time span.

bool IsEmptyDate(void) const

Is date empty?

void GetExpirationTime(time_t *sec, unsigned int *nanosec) const

Get the number of seconds and nanoseconds (since 1/1/1970).

string x_AsSmartString_Smart_Big(TSmartStringFlags flags) const

Helpers for AsSmartString()

@ eCurrent

Use current time. See also CCurrentTime.

@ eErr_Throw

Throw an exception on error.

@ eErr_NoThrow

Return default value on error.

@ eUTC

UTC (Universal Coordinated Time)

@ eGmt

GMT (Greenwich Mean Time)

@ eConvert

Error converting value from one format to another.

@ eFormat

Incorrect format.

@ eInvalid

Invalid time value.

@ eArgument

Bad function argument.

@ eAdjustDaylight

Adjust for daylight saving time.

@ eIgnoreDaylight

Ignore daylight saving time.

@ eDefault

Default timeout (to be interpreted by the client code)

@ eInfinite

Infinite timeout.

@ eFinite

A finite timeout value has been set.

@ eZero

Zero timeout, equal to CTimeout(0,0).

@ eMinute

Check condition - new minute.

@ eMonth

Check condition - new month.

@ eDay

Check condition - new day.

@ eHour

Check condition - new hour.

@ eStop

Do not start timer, just create it.

@ fSS_Precision4

Floating precision level 4.

@ fSS_Nanosecond

Do not round at all (accurate time span)

@ fSS_Year

Round to years.

@ fSS_Precision6

Floating precision level 6.

@ fSS_Millisecond

Round to milliseconds.

@ fSS_Hour

Round to hours.

@ fSS_Precision7

Floating precision level 7.

@ fSS_Precision2

Floating precision level 2.

@ fSS_Microsecond

Round to microseconds.

@ fSS_Precision5

Floating precision level 5.

@ fSS_Precision1

Floating precision level 1.

@ fSS_Smart

Be as smart as possible (see above)

@ fSS_PrecisionMask

Mask of precision flags (sum of all above)

@ fSS_Precision3

Floating precision level 3.

@ fSS_Month

Round to months.

@ fSS_Minute

Round to minutes.

@ fSS_Second

Round to seconds.

@ eRound_Minute

Round to minutes.

@ eRound_Day

Round to days.

@ eRound_Hour

Round to hours.

@ eRound_Millisecond

Round to milliseconds.

@ eRound_Second

Round to seconds.

@ eRound_Microsecond

Round to microseconds.

@ fFormat_Ncbi

Specify each format symbol with a preceding symbol '$'.

@ fMatch_Weak

Combination of both modes above.

@ fMatch_IgnoreSpaces

Ignore all white spaces in the time and format strings on the matching/parsing step (CTime only).

@ fMatch_ShortFormat

eg "Y" and "1997/07/16"

@ fConf_UTC

Prefer "UTC" over "GMT" abbreviation for universal time.

@ fMatch_ShortTime

A time/format string can have extra trailing format symbols, that do not have matching symbols in the...

@ fFormat_Simple

Use single characters as format symbols.

@ fMatch_Strict

A time string should strictly match the format string.

unsigned int

A callback function used to compare two keys in a database.

Definition of all error codes used in corelib (xncbi.lib).

The blob sat and sat key Both must be positive integers</td > n< td > Non empty string The interpretation of the blob id depends on a processor Cassandra n processor expects the following format

const struct ncbi::grid::netcache::search::fields::SIZE size

const GenericPointer< typename T::ValueType > T2 value

Static variables safety - create on demand, destroy on application termination.

int gettimeofday(struct timeval *tp, void *unused)

#define NCBI_CONST_UINT8(v)

void * SwapPointers(void *volatile *location, void *new_value)

Multi-threading – mutexes; rw-locks; semaphore.

Multi-threading – classes, functions, and features.

static int s_DaysInMonth[12]

#define CHECK_RANGE_MONTH(value)

const unsigned int kUnitCount

static const char * kDefaultFormatSpan

#define CHECK_RANGE2_NSEC(value, err)

#define COMPARE_TIMEOUT_TYPES(t1, t2)

static const char * kWeekdayAbbr[7]

static const char * kDefaultFormatSpanIn

static const char * kDefaultFormatStopWatch

#define CHECK_RANGE_DAY(value)

static const char * kMonthAbbr[12]

static CTime s_Number2Date(unsigned num, const CTime &t)

#define CHECK_RANGE2_YEAR(value, err)

static const TSeconds kTimeSpanUnitMultipliers[kUnitCount]

#define CHECK_RANGE2_SEC(value, err)

static const char * kMonthFull[12]

static void s_AddZeroPadInt(string &str, long value, size_t len, bool ignore_trailing_zeros=false)

static const char * kWeekdayFull[7]

#define CHECK_RANGE2_HOUR24(value, err)

static CStaticTls< CTimeFormat > s_TlsFormatTime

static string s_TimeDump(const CTime &time)

static void s_AddZeroPadInt2(string &str, long value)

#define CHECK_RANGE2_MONTH(value, err)

#define CHECK_RANGE2_HOUR12(value, err)

static CStaticTls< CTimeFormat > s_TlsFormatStopWatch

#define CHECK_RANGE_SEC(value)

bool s_IsDST(const CTime &ct)

#define CHECK_RANGE_MIN(value)

static CSafeStatic< CFastLocalTime > s_FastLocalTime

static unsigned s_Date2Number(const CTime &date)

static const char * kFormatSymbolsSpan

static const SUnitName kUnitNames[kUnitCount]

static void s_Offset(long *value, Int8 offset, long bound, int *major)

static const char * kFormatSymbolsTime

static CStaticTls< CTimeFormat > s_TlsFormatSpan

#define X_INIT_ERROR(type, msg)

static void s_AddInt(string &str, long value)

#define CHECK_RANGE2_DAY(value, err)

DEFINE_STATIC_MUTEX(s_TimeMutex)

const char kFormatEscapeSymbol

time_t s_GetTimeT(const CTime &ct)

#define CHECK_RANGE_NSEC(value)

#define CHECK_RANGE_YEAR(value)

static const char * kDefaultFormatTime

#define CHECK_RANGE2_MIN(value, err)

static string s_SpecialValueName(CTimeout::EType type)

#define CHECK_RANGE_HOUR(value)

Defines: CTimeFormat - storage class for time format.

T bound(T x_, T xlo_, T xhi_)

Database format for time where day and time is signed 32 bit.

Database format for time where day and time is unsigned 16 bit.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4