Horus Doc || C++ Reference || Class Overview   Pixels   Images   Detector   Geometry   Registry || Doxygen's quick Index  

HxStringList.h

Go to the documentation of this file.
00001 /*
00002  *  Copyright (c) 1997, University of Amsterdam, The Netherlands.
00003  *  All rights reserved.
00004  *
00005  *
00006  *  Author(s):
00007  *  Dennis Koelma (koelma@wins.uva.nl)
00008  *  Edo Poll (poll@wins.uva.nl)
00009  */
00010 
00013 #ifndef HxStringList_h
00014 #define HxStringList_h
00015 
00016 #include "HxString.h"
00017 #include <list>
00018 #include <vector>
00019 
00020 
00024 class HxStringList : public std::list<HxString>
00025 {
00026 public:
00027                         HxStringList() {};
00028                         HxStringList(const std::list<std::string>& l);
00029                         HxStringList(const std::vector<std::string>& l);
00030 
00032     typedef std::back_insert_iterator<HxStringList>  back_insert_iterator;
00033 
00035     HxStringList&       operator<<(const HxString&);
00036 
00038     void                eraseAll();
00039 };
00040 
00042 typedef HxStringList::iterator              HxStringListIter;
00043 
00045 typedef HxStringList::const_iterator        HxStringListConstIter;
00046 
00048 typedef HxStringList::back_insert_iterator  HxStringListBackInserter;
00049 
00050 inline HxStringList&
00051 HxStringList:: operator<<(const HxString& s)  // the space after :: is for DOC++
00052 {
00053     push_back(s);
00054     return *this;
00055 }
00056 
00057 inline void
00058 HxStringList::eraseAll()
00059 {
00060     erase(begin(), end());
00061 }
00062 
00063 inline
00064 HxStringList::HxStringList(const std::list<std::string>& l)
00065 {
00066     std::copy(l.begin(), l.end(), std::back_inserter(*this));
00067 }
00068 
00069 inline
00070 HxStringList::HxStringList(const std::vector<std::string>& v)
00071 {
00072     std::copy(v.begin(), v.end(), std::back_inserter(*this));
00073 }
00074 
00075 L_HXBASIS HxString
00076 makeString(HxStringListConstIter begin, HxStringListConstIter end,
00077     HxString separator = HxString(" "));
00078 
00079 int
00080 splitString(HxString src, char separator, HxStringListBackInserter);
00081 
00082 #endif

Generated on Tue Feb 3 14:18:42 2004 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001