Using FILE-- in your project

All you need to do, is to include those file in your project code. You can copy the header files into your source code, or you can use them from their installed location - it's entirely up to you, though you should read and understand the terms of the licence

The included file filemm.m4 defines the Autoconf macro AM_FILEMM_PATH that you can use in your configure.ac file. It defines the substitution variable FILEMM_CPPFLAGS to contain the path to the FILE-- header files. Put that macro in your configuration file

    ...
    AM_FILEMM_PATH
    ... 
    

and in your Makefile.ams, do

    ...
    AM_CPPFLAGS		= $(FILEMM_CPPFLAGS) 
    ...
    

Alternatively, you can use the included script filemm-config to obtain the information.

Compatibility

Some older compilers does not provide standard headers, in particular std::char_traits<typename Char_Type> may be missing, and std::streambuf may not define the nested types std::streambuf::char_type, std::streambuf::int_type, and std::streambuf::traits_type.

In case that std::char_traits<typename Char_Type> isn't defined, FILE-- provides an implementation - just define FILEMM_NEED_CHAR_TRAITS in your source file before including filemm/streambuf.hh

    #define FILEMM_NEED_CHAR_TRAITS
    #ifndef FILEMM_streambuf
    # include <filemm/streambuf.hh>
    #endif

In case std::streambuf doesn't define the nested types, define FILEMM_NEED_STREAMBUF_TYPES in your source file before including filemm/streambuf.hh

    #define FILEMM_NEED_STREAMBUF_TYPES
    #ifndef FILEMM_streambuf
    # include <filemm/streambuf.hh>
    #endif

If you use the provided Autoconf macros, all these checks can be done for you automatically. Put lines like

    AM_FILEMM_PATH
    AM_FILEMM_NEED_CHAR_TRAITS
    AM_FILEMM_NEED_STREAMBUF_H
    AM_FILEMM_NEED_STREAMBUF_TYPES
    
in your configure.ac file, and include the (optional) configuration header before including filemm/streambuf.hh
    #ifndef HAVE_CONFIG_H
    # include "config.h"   // Name may vary depending on AC_CONFIG_HEADERS
    #endif
    #ifndef FILEMM_streambuf
    # include <filemm/streambuf.hh>
    #endif

See also:
wchar_t based streams support
Top of page
Last update Wed Apr 13 07:51:08 2005
Christian Holm
Created by DoxyGen 1.4.2