12 #ifndef _HFST_OUTPUTSTREAM_H_
13 #define _HFST_OUTPUTSTREAM_H_
27 namespace implementations {
30 class LogWeightOutputStream;
32 class TropicalWeightOutputStream;
35 class SfstOutputStream;
38 class FomaOutputStream;
40 #if HAVE_MY_TRANSDUCER_LIBRARY
41 class MyTransducerLibraryOutputStream;
43 class HfstOlOutputStream;
70 union StreamImplementation
74 hfst::implementations::LogWeightOutputStream * log_ofst;
76 hfst::implementations::TropicalWeightOutputStream * tropical_ofst;
79 hfst::implementations::SfstOutputStream * sfst;
82 hfst::implementations::FomaOutputStream * foma;
85 #if HAVE_MY_TRANSDUCER_LIBRARY
87 my_transducer_library;
90 hfst::implementations::HfstOlOutputStream * hfst_ol;
95 StreamImplementation implementation;
98 void write(
const std::string &s);
99 void write(
const std::vector<char> &s);
100 void write(
const char &c);
106 static void append(std::vector<char> &str,
const std::string &s);
109 void append_hfst_header_data(std::vector<char> &header);
112 void append_implementation_specific_header_data
~HfstOutputStream(void)
Destructor.
Definition: HfstOutputStream.cc:140
A synchronous finite-state transducer.
Definition: HfstTransducer.h:227
A skeleton class for writing a new type of binary transducers to a stream.
Definition: MyTransducerLibraryTransducer.h:115
ImplementationType
The type of an HfstTransducer.
Definition: HfstDataTypes.h:43
A stream for writing binary transducers.
Definition: HfstOutputStream.h:67
HfstOutputStream(ImplementationType type, bool hfst_format=true)
Create a stream to standard output for writing binary transducers of type type. hfst_format defines w...
Definition: HfstOutputStream.cc:24
Datatypes that are needed when using the HFST API.
void close(void)
Close the stream.
Definition: HfstOutputStream.cc:444
HfstOutputStream & redirect(HfstTransducer &transducer)
An alias for operator<<.
Definition: HfstOutputStream.cc:310
HfstOutputStream & operator<<(HfstTransducer &transducer)
Write the transducer transducer in binary format to the stream.
Definition: HfstOutputStream.cc:315