home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 1 / Meeting Pearls Vol 1 (1994).iso / installed_progs / dev / flexcat / c++_catalogf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-05-27  |  1.7 KB  |  44 lines

  1. #ifndef CATALOGF_H
  2. #define CATALOGF_H
  3. // This is the header (interface) for the LocaleF class, where it is defined.
  4. // In order to use this class, include this file in your code.
  5.  
  6. // You need to initialize LocaleBase in main() yourself, since
  7. // auto-library-open that some compilers have exit when it can not open
  8. // the library, and in this case, we do not need to exit, simply use the
  9. // built-in strings ...
  10. // Well this is not really truth. I have changed the locale portion of
  11. // libauto.a (GNUC++ 2.5.8) so that I can use auto-open with locale. This
  12. // way, I do not have to open LocaleBase myself. I hope this changes will be
  13. // included in next distributions of GNUC++. Till that there are two ways:
  14. // open locale.library yourself, or tell me to mail you the new libauto.a...
  15. extern struct LocaleBase* LocaleBase;
  16.  
  17. #include <exec/types.h>
  18.  
  19. // Here we define the data type that will be used defining the strings
  20. // from the .cd file ...
  21. typedef const struct {
  22.                        LONG   ID;
  23.                        STRPTR cadena;
  24.                      } MensajeCAT;
  25.  
  26. class CatalogF
  27. {
  28. public:
  29.     CatalogF( struct Locale *loc,
  30.               const STRPTR language,
  31.               const STRPTR catalogfile,
  32.               const STRPTR builtInLanguage,
  33.               const LONG version );
  34.     const STRPTR GetString(MensajeCAT& mens) const;
  35.                                      // get the string of this ID
  36.                                      // we give a const struct and return
  37.                                      // a const pointer
  38.     ~CatalogF();      // simply close the catalog
  39. private:
  40.     struct Catalog* catalogo;  
  41. }; // THIS SEMICOLON IS ESSENTIAL (TWO HOURS to realize for that!!!)
  42.  
  43. #endif //  CATALOGF_H
  44.