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 _clucene_backwards_h 00008 #define _clucene_backwards_h 00009 00010 //In light of the recent major changes to clucene, 00011 //this file should help to maintain some backwards compatibility 00012 //include it after including StdHeader.h 00013 // 00014 //Note: I haven't tested this much, so please send me your changes 00015 00016 //dirent is one of the most major changes that won't easily port. 00017 //you can use the TCHAR copying macros, STRCPY_TtoA and STRCPY_AtoT 00018 //to copy between different character types. 00019 00020 //If you use stringPrintF, you will need to add the target string 00021 //size parameter, because it is using _sntprintf... Change this if you 00022 //want, but _sntprintf is much safer 00023 00024 #define char_t TCHAR 00025 #define uchar_t TCHAR 00026 #define l_byte_t byte_t 00027 00028 //#define stringSpn _tcsspn //not used in clucene anymore 00029 #define stringCSpn _tcscspn 00030 #define stringLength _tcslen 00031 //#define stringToInteger _ttoi //not used in clucene anymore, use integer w/ base 00032 #define stringFind _tcsstr 00033 #define stringFindChar _tcschr 00034 #define stringCompare _tcscmp 00035 #define stringNCopy _tcsncpy 00036 #define stringCopy _tcscpy 00037 #define stringCat _tcscat 00038 //#define stringToken _tcstok //not used in clucene anymore 00039 #define stringPrintF _sntprintf //you will have errors, because now we used printf w/ bufferlen count 00040 #define printFormatted _tprintf 00041 00042 //conversion functions 00043 #define integerToString _i64tot 00044 #define stringToIntegerBase _tcstoi64 00045 #define stringToFloat _tcstod 00046 00047 //file find structures 00048 #define Cmd_Stat fileStat 00049 #define Struct_Stat fileStat 00050 #define stringICompare _tcsicmp 00051 #define stringNCompare _tcsncmp 00052 #define stringDifference _tcscmp 00053 00054 //character conversion functions 00055 #define isSpace _istspace 00056 #define isDigit _istwdigit 00057 #define isAlNum _istwalnum 00058 #define toLower _totlower 00059 #define stringUpper _tcsupr 00060 //#define stringLower _tcslwr //not used in clucene anymore 00061 00062 #define _THROWX(y) _THROWT(y) 00063 #define _THROWC(y) _THROWA(y) 00064 00065 //file naming stuff - remember we have changed all names to file naming lower case 00066 #define fileRename _rename 00067 #define fileFullName(abs,rel) _realpath(rel,abs) 00068 #define makeDirectory _tmkdir 00069 #define unlinkFile _unlink 00070 00071 //no longer supported definitions 00072 #ifdef _UNICODE 00073 #define TO_CHAR_T STRDUP_AtoT 00074 #define _cout wcout 00075 #define _cin wcin 00076 #define _cerr wcerr 00077 #else 00078 #define TO_CHAR_T STRDUP_WtoT 00079 #define _cout cout 00080 #define _cin cin 00081 #define _cerr cerr 00082 #endif 00083 00084 //some headers that used to be automatically included: 00085 #include "CLucene/util/dirent.h" //if we have dirent, then the native one will be used 00086 00087 #endif