diff options
Diffstat (limited to 'src/Date.cpp')
| -rw-r--r-- | src/Date.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/Date.cpp b/src/Date.cpp new file mode 100644 index 0000000..56e1e8e --- /dev/null +++ b/src/Date.cpp | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | /* | ||
| 2 | * Date.cpp | ||
| 3 | * | ||
| 4 | * Copyright (c) 2009 Jonathan Beck All Rights Reserved. | ||
| 5 | * | ||
| 6 | * This library is free software; you can redistribute it and/or | ||
| 7 | * modify it under the terms of the GNU Lesser General Public | ||
| 8 | * License as published by the Free Software Foundation; either | ||
| 9 | * version 2.1 of the License, or (at your option) any later version. | ||
| 10 | * | ||
| 11 | * This library is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 14 | * Lesser General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU Lesser General Public | ||
| 17 | * License along with this library; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 19 | */ | ||
| 20 | |||
| 21 | #include <stdlib.h> | ||
| 22 | #include <plist/Date.h> | ||
| 23 | |||
| 24 | namespace PList | ||
| 25 | { | ||
| 26 | |||
| 27 | Date::Date() : Node(PLIST_DATE) | ||
| 28 | { | ||
| 29 | } | ||
| 30 | |||
| 31 | Date::Date(uint64_t i) : Node(PLIST_DATE) | ||
| 32 | { | ||
| 33 | plist_set_date_val(_node, i, 0); | ||
| 34 | } | ||
| 35 | |||
| 36 | Date::~Date() | ||
| 37 | { | ||
| 38 | } | ||
| 39 | |||
| 40 | void Date::SetValue(uint64_t i) | ||
| 41 | { | ||
| 42 | plist_set_date_val(_node, i, 0); | ||
| 43 | } | ||
| 44 | |||
| 45 | uint64_t Date::GetValue() | ||
| 46 | { | ||
| 47 | int32_t i = 0; | ||
| 48 | plist_get_date_val(_node, &i, &i); | ||
| 49 | return i; | ||
| 50 | } | ||
| 51 | |||
| 52 | }; | ||
