--- parser3/src/include/pa_charsets.h 2003/01/21 15:51:09 1.8 +++ parser3/src/include/pa_charsets.h 2015/10/13 21:27:57 1.16 @@ -1,7 +1,7 @@ /** @file Parser: sql driver manager decl. - Copyright (c) 2001, 2003 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) @@ -11,21 +11,28 @@ #ifndef PA_CHARSETS_H #define PA_CHARSETS_H -static const char* IDENT_CHARSETS_H="$Date: 2003/01/21 15:51:09 $"; +#define IDENT_PA_CHARSETS_H "$Id: pa_charsets.h,v 1.16 2015/10/13 21:27:57 moko Exp $" #include "pa_hash.h" +#include "pa_charset.h" -class Charsets : public Hash { +/// convention: use UPPERCASE keys +class Charsets: public HashString { public: - Charsets(Pool& apool); - ~Charsets(); - Charset& get_charset(const String& name); - void load_charset(const String& request_name, const String& request_file_spec); -}; + Charsets(); + + Charset& get(const String::Body ANAME); -/// global -extern Charsets *charsets; + void load_charset(Request_charsets& charsets, const String::Body ANAME, const String& afile_spec); + + // detects charset if it's not enforced, skips BOM signature if it complies charset + static Charset* checkBOM(char *&body,size_t &body_size, Charset* enforced_charset); +}; +//@{ globals +extern Charset UTF8_charset; +extern Charsets charsets; +//@} #endif