/usr/include/dclib-0.3/dclib/ccasefolder.h is in libdc-dev 0.3.24~svn3121-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | /***************************************************************************
ccasefolder.h - Get a case folded version of a string
-------------------
begin : Thu Jul 17 2008
copyright : (C) 2008 by Edward Sheldrake
email : ejs1920@yahoo.co.uk
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef CCASEFOLDER_H
#define CCASEFOLDER_H
/**
* author Edward Sheldrake
*
* This class produces a case folded version of a string, required to
* make comparisions / searching case insensitive. It does not matter
* if it's uppercase, lowercase or some mixture, just that both strings
* have been processed by the same algorithm.
*
* This does full case mapping and the output may be longer than the
* input.
*
* The data is based on CaseFolding-5.1.0.txt from the Unicode Character
* Database.
*
* This class appears to be necessary because the C function toupper()
* does not handle UTF-8 and converting to wchar_t and using towupper()
* also leaves all the accented characters unconverted.
*
* Other software: Shakespeer seems to have various unicode data
* tables in it's source under splib/unicode-spec but DC++ relies
* on CharLowerW on Windows and towlower() elsewhere.
*
* QT's QString class works entirely in unicode and has a toLower()
* function that handles everything, not just ascii A-Z.
*/
#include <dclib/dcos.h>
#include <dclib/core/cstring.h>
#include <iconv.h>
class CCaseFolder {
public:
/** Constructor */
CCaseFolder();
/** Destructor */
~CCaseFolder();
/**
* Do the case folding. To reduce copying, a CString to put the
* output in is a parameter.
*
* Returns true if everything suceeded.
*/
bool Fold( const CString & input, CString & output );
private:
/** local to UCS-4 */
iconv_t to_ucs4;
/** UCS-4 to local */
iconv_t from_ucs4;
};
#endif // CCASEFOLDER_H
|