Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
LinearString.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <string/LinearString.h>
9#include <core/rawApi.hpp>
10
11#include <iterator>
12
13namespace core {
14
15template < class SymbolType >
16struct rawApi < string::LinearString < SymbolType > > {
18 static void compose ( ext::ostream & output, const string::LinearString < SymbolType > & string );
19};
20
21template < class SymbolType >
24
25 std::istreambuf_iterator < char > input_iter ( input.rdbuf ( ) );
26 input >> std::noskipws;
27
28 for ( ; input_iter != std::istreambuf_iterator < char > ( ); ++ input_iter ) {
29 data.push_back ( SymbolType ( * input_iter ) );
30 }
32}
33
34template < class SymbolType >
36 for(const SymbolType & symbol : string.getContent()) {
37 output << ext::to_string ( symbol );
38 }
39}
40
41} /* namespace core */
42
Definition: istream.h:32
std::streambuf * rdbuf() const
Definition: istream.cpp:88
Definition: ostream.h:14
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
Linear string.
Definition: LinearString.h:57
typename T::SymbolType SymbolType
Definition: ReachableStates.h:176
Definition: normalize.hpp:10
std::string to_string(const T &value)
To string method designated for objects that can be casted to string.
Definition: string.hpp:131
Definition: RandomStringFactory.cpp:12
Definition: rawApi.hpp:11