1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
|
<html>
<head>
<title>~/src/firstworks/rudiments-0.31/include/rudiments/timezonefile.h.html</title>
<meta name="Generator" content="Vim/7.0">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#ffffff" text="#000000">
<pre>
<font color="#0000ff">// Copyright (c) 2003 David Muse</font>
<font color="#0000ff">// See the COPYING file for more information</font>
<font color="#a020f0">#ifndef RUDIMENTS_TIMEZONEFILE_H</font>
<font color="#a020f0">#define RUDIMENTS_TIMEZONEFILE_H</font>
<font color="#a020f0">#include </font><font color="#ff00ff"><rudiments/private/config.h></font>
<font color="#0000ff">// The timezonefile class provides methods for parsing and accessing timezone</font>
<font color="#0000ff">// files such as are typically found in /usr/share/zoneinfo.</font>
<font color="#a020f0">#ifdef RUDIMENTS_NAMESPACE</font>
<font color="#2e8b57"><b>namespace</b></font> rudiments {
<font color="#a020f0">#endif</font>
<font color="#2e8b57"><b>class</b></font> timezonefileprivate;
<font color="#2e8b57"><b>struct</b></font> ttinfo {
<font color="#2e8b57"><b>long</b></font> tt_gmtoff;
<font color="#2e8b57"><b>int</b></font> tt_isdst;
<font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>int</b></font> tt_abbrind;
};
<font color="#2e8b57"><b>class</b></font> timezonefile {
<font color="#a52a2a"><b>public</b></font>:
timezonefile();
timezonefile(<font color="#2e8b57"><b>const</b></font> timezonefile &t);
timezonefile &<font color="#a52a2a"><b>operator</b></font>=(<font color="#2e8b57"><b>const</b></font> timezonefile &t);
~timezonefile();
<font color="#2e8b57"><b>bool</b></font> parseFile(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *filename);
<font color="#0000ff">// Parses "filename". Returns true on success</font>
<font color="#0000ff">// and false on failure.</font>
<font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>long</b></font> getTimeCount();
<font color="#0000ff">// Returns the number of transition times or</font>
<font color="#0000ff">// local times stored in the file.</font>
<font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>long</b></font> *getTransitionTimes();
<font color="#0000ff">// Returns an array of transition times.</font>
<font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>long</b></font> getTransitionTime(<font color="#2e8b57"><b>int</b></font> index);
<font color="#0000ff">// Returns the transition time at "index".</font>
<font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>char</b></font> *getLocalTimes();
<font color="#0000ff">// Returns an array of local times.</font>
<font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>char</b></font> getLocalTimes(<font color="#2e8b57"><b>int</b></font> index);
<font color="#0000ff">// Returns the local time at "index".</font>
<font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>long</b></font> getTypeCount();
<font color="#0000ff">// Returns the number of time type info's</font>
<font color="#0000ff">// stored in the file.</font>
ttinfo **getTimeTypeInfos();
<font color="#0000ff">// Returns an array of time type info's.</font>
ttinfo *getTimeTypeInfo(<font color="#2e8b57"><b>int</b></font> index);
<font color="#0000ff">// Returns the time type info at "index".</font>
<font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>long</b></font> getLeapCount();
<font color="#0000ff">// Returns the number of leap second times or</font>
<font color="#0000ff">// total leap seconds in the file.</font>
<font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>long</b></font> *getLeapSecondTimes();
<font color="#0000ff">// Returns an array of leap second times.</font>
<font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>long</b></font> getLeapSecondTime(<font color="#2e8b57"><b>int</b></font> index);
<font color="#0000ff">// Returns the leap second time at "index".</font>
<font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>long</b></font> *getTotalLeapSeconds();
<font color="#0000ff">// Returns an array of total leap seconds.</font>
<font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>long</b></font> getTotalLeapSeconds(<font color="#2e8b57"><b>int</b></font> index);
<font color="#0000ff">// Returns the total leap seconds at "index".</font>
<font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>long</b></font> getIsSTDCount();
<font color="#0000ff">// Returns the number of standard or wall</font>
<font color="#0000ff">// indicators in the file.</font>
<font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>char</b></font> *getStandardOrWallIndicators();
<font color="#0000ff">// Returns an array of standard or wall</font>
<font color="#0000ff">// indicators.</font>
<font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>char</b></font> getStandardOrWallIndicator(<font color="#2e8b57"><b>int</b></font> index);
<font color="#0000ff">// Returns the standard or wall indicator at</font>
<font color="#0000ff">// "index".</font>
<font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>long</b></font> getIsGMTCount();
<font color="#0000ff">// Returns the number of GMT/UTC or local</font>
<font color="#0000ff">// indicators in the file.</font>
<font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>char</b></font> *getUTCOrLocalIndicators();
<font color="#0000ff">// Returns an array of UTC or local indicators.</font>
<font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>char</b></font> getUTCOrLocalIndicator(<font color="#2e8b57"><b>int</b></font> index);
<font color="#0000ff">// Returns the UTC or local indicator at</font>
<font color="#0000ff">// "index".</font>
<font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>long</b></font> getCharacterCount();
<font color="#0000ff">// Returns the number of characters in the</font>
<font color="#0000ff">// raw time zone string.</font>
<font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>char</b></font> *getRawTimeZoneString();
<font color="#0000ff">// Returns the raw time zone string.</font>
<font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>char</b></font> **getTimeZoneStrings();
<font color="#0000ff">// Returns an array of time zone strings.</font>
<font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>char</b></font> *getTimeZoneString(<font color="#2e8b57"><b>int</b></font> index);
<font color="#0000ff">// Returns the time zone string at "index".</font>
<font color="#2e8b57"><b>void</b></font> print();
<font color="#0000ff">// Prints out a representation of the timezone</font>
<font color="#0000ff">// file.</font>
<font color="#a020f0"> #include </font><font color="#ff00ff"><rudiments/private/timezonefile.h></font>
};
<font color="#a020f0">#ifdef RUDIMENTS_NAMESPACE</font>
}
<font color="#a020f0">#endif</font>
<font color="#a020f0">#endif</font>
</pre>
</body>
</html>
|