list_parsing.h

Go to the documentation of this file.
00001 #ifndef LIST_PARSING_CLASS
00002 #define LIST_PARSING_CLASS
00003 
00004 /*****************************************************************************\
00005 *                                                                             *
00006 *  Name   : list_parsing                                                      *
00007 *  Author : Chris Koeritz                                                     *
00008 *  Author : Gary Hardley                                                      *
00009 *  Author : Brit Minor                                                        *
00010 *  Author : Aaron Buchanan                                                    *
00011 *                                                                             *
00012 *******************************************************************************
00013 * Copyright (c) 2002-$now By Author.  This program is free software; you can  *
00014 * redistribute it and/or modify it under the terms of the GNU General Public  *
00015 * License as published by the Free Software Foundation; either version 2 of   *
00016 * the License or (at your option) any later version.  This is online at:      *
00017 *     http://www.fsf.org/copyleft/gpl.html                                    *
00018 * Please send any updates to: fred@gruntose.com                               *
00019 \*****************************************************************************/
00020 
00021 #include "textual_dll.h"
00022 
00023 #include <basis/object_base.h>
00024 
00025 // forward.
00026 class string_table;
00027 
00029 
00030 class TEXTUAL_CLASS_STYLE list_parsing
00031 {
00032 public:
00033   virtual ~list_parsing();
00034   IMPLEMENT_CLASS_NAME("list_parsing");
00035 
00036   static bool get_ids_from_string(const istring &string, int_set &ids);
00038 
00042   static bool get_ids_from_string(const istring &string, int_array &ids);
00044 
00046   static istring put_ids_in_string(const int_set &ids, char separator = ',');
00048 
00049   static istring put_ids_in_string(const int_array &ids, char separator = ',');
00051 
00052   static bool get_values_from_string(const istring &string,
00053           string_array &values, const char separator = ',',
00054           const bool strip_spaces = true);
00056 
00061   static bool get_separated_value(const istring &string, const istring &name, 
00062           istring &value, const byte assign = '=', const byte separator = ',');
00064 
00069   static bool get_rest_of_line(const istring &string, const istring &name,
00070           istring &value, const byte assign = '=');
00072 
00075   static int get_positions(const istring &string, const char separator, 
00076           int_array &positions);
00078 
00081   static istring emit_quoted_chunk(const istring &to_emit);
00083 
00084   static bool parse_csv_line(const istring &to_parse, string_array &fields);
00086 
00091   static void create_csv_line(const string_array &to_csv, istring &target);
00092   static void create_csv_line(const string_table &to_csv, istring &target);
00094 
00096 };
00097 
00098 #endif
00099 

Generated on Fri Nov 28 04:29:33 2008 for HOOPLE Libraries by  doxygen 1.5.1