X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fchset.h;h=a3691af1df5e1308193ad97a60cf4d27f35f69b8;hb=77866d9e88cbbd1f5f580a7daf15751352792e12;hp=b2707b844fc1e8400ff68e2a899de483da045c13;hpb=56368d8c03f1e89cf480d248eea65139d5395a15;p=lyx.git diff --git a/src/chset.h b/src/chset.h index b2707b844f..a3691af1df 100644 --- a/src/chset.h +++ b/src/chset.h @@ -1,4 +1,10 @@ // -*- C++ -*- +/** + * \file chset.h + * Copyright 2002 the LyX Team + * Read the file COPYING + */ + #ifndef CHSET_H #define CHSET_H @@ -7,31 +13,37 @@ #endif #include -using std::map; - #include -using std::pair; -using std::make_pair; // may also be put in chset.C #include "LString.h" -using std::map; - -/// +/// a class for mapping char strings such as "\^{A}" to the integer value class CharacterSet { public: - /// - bool loadFile(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(string const & charset); + /// return the name of the current charset string const & getName() const; - /// - pair encodeString(string &) 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(string const &) const; private: - /// + /// charset name string name_; /// - typedef map Cdef; - /// + typedef std::map Cdef; + /// mapping from string representation to encoded value Cdef map_; }; #endif