#include "CLucene/StdHeader.h" #include "DateField.h" #include "CLucene/util/Misc.h" using namespace lucene::util; using namespace std; namespace lucene{ namespace document{ /** Converts a millisecond time to a string suitable for indexing. */ char_t* DateField::timeToString(const long_t time) { if (time < 0) _THROWC ("time too early"); char_t* buf = new char_t[DATE_LEN+1]; integerToString(time,buf,CHAR_RADIX); int_t bufLen = stringLength(buf); if ( bufLen > DATE_LEN) _THROWC ( "time too late"); if ( bufLen < DATE_LEN ){ for ( int i=DATE_LEN-1;i>=DATE_LEN-bufLen;i-- ) buf[i] = buf[i-(DATE_LEN-bufLen)]; for ( int i=0;i