CLucene - a full-featured, c++ search engine
API Documentation
00001 /*------------------------------------------------------------------------------ 00002 * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team 00003 * 00004 * Distributable under the terms of either the Apache License (Version 2.0) or 00005 * the GNU Lesser General Public License, as specified in the COPYING file. 00006 ------------------------------------------------------------------------------*/ 00007 #ifndef _lucene_document_DateTools_ 00008 #define _lucene_document_DateTools_ 00009 00010 CL_NS_DEF(document) 00011 00012 00013 class DateTools :LUCENE_BASE { 00014 #define DATETOOLS_BUFFER_SIZE 20 00015 public: 00016 00017 enum Resolution { 00018 YEAR_FORMAT, // yyyy 00019 MONTH_FORMAT, // yyyyMM 00020 DAY_FORMAT, // yyyyMMdd 00021 HOUR_FORMAT, // yyyyMMddHH 00022 MINUTE_FORMAT, // yyyyMMddHHmm 00023 SECOND_FORMAT, // yyyyMMddHHmmss 00024 MILLISECOND_FORMAT // yyyyMMddHHmmssSSS 00025 }; 00026 00035 static TCHAR* timeToString(const int64_t time, Resolution resolution = MILLISECOND_FORMAT); 00036 00037 static void timeToString(const int64_t time, Resolution resolution, TCHAR* buf); 00038 00049 static int64_t stringToTime(const TCHAR* dateString); 00050 00051 ~DateTools(); 00052 00053 }; 00054 CL_NS_END 00055 #endif