1 // 2 // aegis - project change supervisor 3 // Copyright (C) 1991-1996, 1999, 2002-2006, 2008, 2012 Peter Miller 4 // 5 // This program is free software; you can redistribute it and/or modify 6 // it under the terms of the GNU General Public License as published by 7 // the Free Software Foundation; either version 3 of the License, or (at 8 // your option) any later version. 9 // 10 // This program is distributed in the hope that it will be useful, 11 // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 // General Public License for more details. 14 // 15 // You should have received a copy of the GNU General Public License 16 // along with this program. If not, see <http://www.gnu.org/licenses/>. 17 // 18 19 #ifndef LIBAEGIS_IO_H 20 #define LIBAEGIS_IO_H 21 22 #include <common/ac/time.h> 23 24 #include <libaegis/meta_type.h> 25 #include <libaegis/output.h> 26 27 struct sub_context_ty; // forward 28 class nstring; // forward 29 30 #define INTEGER_NOT_SET 0 31 #define REAL_NOT_SET 0.0 32 #define TIME_NOT_SET (time_t)0 33 34 void boolean_write(output::pointer, const char *, bool, int); 35 void boolean_write_xml(output::pointer, const char *, bool, int); 36 37 /** 38 * The string_write function is used to write aout a name value pair 39 * to the given output stream, in a format suitable for reading by the 40 * meta-date parser. 41 * 42 * @param op 43 * The output stream to write on. 44 * @param name 45 * The name of the field. 46 * @param value 47 * The value of the field. 48 */ 49 void string_write(output::pointer op, const char *name, string_ty *value); 50 51 /** 52 * The string_write function is used to write aout a name value pair 53 * to the given output stream, in a format suitable for reading by the 54 * meta-date parser. 55 * 56 * @param op 57 * The output stream to write on. 58 * @param name 59 * The name of the field. 60 * @param value 61 * The value of the field. 62 */ 63 void string_write(output::pointer op, const char *name, const nstring &value); 64 65 /** 66 * The string_write _xmlfunction is used to write out an XML element 67 * and its value. 68 * 69 * @param op 70 * The output stream to write on. 71 * @param name 72 * The name of the elsement. 73 * @param value 74 * The value of the elsement. 75 */ 76 void string_write_xml(output::pointer op, const char *name, string_ty *value); 77 78 /** 79 * The string_write_xml function is used to write out an XML element 80 * and its value. 81 * 82 * @param op 83 * The output stream to write on. 84 * @param name 85 * The name of the elsement. 86 * @param value 87 * The value of the elsement. 88 */ 89 void string_write_xml(output::pointer op, const char *name, 90 const nstring &value); 91 92 void integer_write(output::pointer , const char *, long, int); 93 void integer_write_xml(output::pointer , const char *, long, int); 94 void real_write(output::pointer , const char *, double, int); 95 void real_write_xml(output::pointer , const char *, double, int); 96 void time_write(output::pointer , const char *, time_t, int); 97 void time_write_xml(output::pointer , const char *, time_t, int); 98 void io_comment_append(sub_context_ty *, const char *); 99 void io_comment_emit(output::pointer ); 100 101 #endif // LIBAEGIS_IO_H 102 // vim: set ts=8 sw=4 et : 103