feisty meow concerns codebase 2.140
eol_aware.h
Go to the documentation of this file.
1#ifndef EOL_AWARE_CLASS
2#define EOL_AWARE_CLASS
3
4/*****************************************************************************\
5* *
6* Name : eol_aware
7* Author : Chris Koeritz
8* *
9*******************************************************************************
10* Copyright (c) 1996-$now By Author. This program is free software; you can *
11* redistribute it and/or modify it under the terms of the GNU General Public *
12* License as published by the Free Software Foundation; either version 2 of *
13* the License or (at your option) any later version. This is online at: *
14* http://www.fsf.org/copyleft/gpl.html *
15* Please send any updates to: fred@gruntose.com *
16\*****************************************************************************/
17
18#include <basis/definitions.h>
19#include <textual/parser_bits.h>
20
21namespace loggers {
22
24
31class eol_aware : public virtual basis::root_object
32{
33public:
34 virtual textual::parser_bits::line_ending eol() { return c_ending; }
36
37 virtual void eol(textual::parser_bits::line_ending to_set) { c_ending = to_set; }
39
42
43 virtual void get_ending(basis::astring &to_end) { to_end = textual::parser_bits::eol_to_chars(c_ending); }
45
46private:
48};
49
50} //namespace.
51
52#endif
53
Provides a dynamically resizable ASCII character string.
Definition astring.h:35
Provides an abstract base for logging mechanisms.
Definition eol_aware.h:32
virtual void eol(textual::parser_bits::line_ending to_set)
modifies how line endings are to be printed.
Definition eol_aware.h:37
virtual void get_ending(basis::astring &to_end)
appends a string for the current ending to "to_end".
Definition eol_aware.h:43
virtual textual::parser_bits::line_ending eol()
observes how line endings are to be printed.
Definition eol_aware.h:34
virtual basis::astring get_ending()
returns a string for the current ending.
Definition eol_aware.h:40
line_ending
Line endings is an enumeration of the separator character(s) used for text files.
Definition parser_bits.h:31
static const char * eol_to_chars(line_ending ending)
returns the C string form for the "ending" value.
Constants and objects used throughout HOOPLE.
A logger that sends to the console screen using the standard output device.