X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fchset.h;h=6b92092838641f40057cd6a311c9169184bfd72f;hb=35204f8f33d7400a5fefeffea533fb4cb4097211;hp=adce167ab17c80b576e6a531bc69d6211d2d46ef;hpb=9ce32d63e5ff1dbf4c04e3d8263b2649ef3ac595;p=lyx.git diff --git a/src/chset.h b/src/chset.h index adce167ab1..6b92092838 100644 --- a/src/chset.h +++ b/src/chset.h @@ -1,34 +1,55 @@ // -*- C++ -*- +/** + * \file chset.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. + * + * \author Lars Gullik Bjønnes + * \author Jean-Marc Lasgouttes + * + * Full author contact details are available in file CREDITS. + */ + #ifndef CHSET_H #define CHSET_H -#ifdef __GNUG__ -#pragma interface -#endif - #include #include +#include -using std::map; -using std::pair; -#include "LString.h" +namespace lyx { -/// +/// a class for mapping char strings such as "\^{A}" to the integer value class CharacterSet { public: - /// - bool loadFile(string const &); - /// - string const & getName() const; - /// - pair encodeString(string &) const; + /** + * initialise this charset from the given .cdef file + * param charset the charset to look for + * + * Finds a .cdef file corresponding to the named charset + * and parses it. This function is only intended to be + * called once. + */ + bool loadFile(std::string const & charset); + /// return the name of the current charset + std::string const & getName() const; + /** + * Return the encoded charset value of the given string. + * + * The bool value is false if an encoding could not be found + * in this charset, and true otherwise. + */ + std::pair const encodeString(std::string const &) const; private: + /// charset name + std::string name_; /// - string name_; - /// - typedef map Cdef; - /// + typedef std::map Cdef; + /// mapping from string representation to encoded value Cdef map_; }; + +} // namespace lyx + #endif