qstringlist.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                            QStringList implementation                         *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 2003 by Niall Douglas.   All Rights Reserved.                   *
00007 *       NOTE THAT I DO NOT PERMIT ANY OF MY CODE TO BE PROMOTED TO THE GPL      *
00008 *********************************************************************************
00009 * This code is free software; you can redistribute it and/or modify it under    *
00010 * the terms of the GNU Library General Public License v2.1 as published by the  *
00011 * Free Software Foundation EXCEPT that clause 3 does not apply ie; you may not  *
00012 * "upgrade" this code to the GPL without my prior written permission.           *
00013 * Please consult the file "License_Addendum2.txt" accompanying this file.       *
00014 *                                                                               *
00015 * This code is distributed in the hope that it will be useful,                  *
00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                          *
00018 *********************************************************************************
00019 * $Id:                                                                          *
00020 ********************************************************************************/
00021 
00022 #ifndef QSTRINGLIST_H
00023 #define QSTRINGLIST_H
00024 
00025 #include "FXString.h"
00026 #include "qvaluelist.h"
00027 
00028 namespace FX {
00029 
00040 class QStringList : public QValueList<FXString>
00041 {
00042 public:
00043     QStringList() : QValueList<FXString>() { }
00044     QStringList(const QStringList &l) : QValueList<FXString>(l) { }
00045     FXADDMOVEBASECLASS(QStringList, QValueList<FXString>)
00046     FXString &operator[](size_type i) { return *at(i); }
00047     const FXString &operator[](size_type i) const { return *at(i); }
00048     QStringList &operator+=(const FXString &d) { QValueList<FXString>::operator+=(d); return *this; }
00050     FXString join(const FXString &sep) const
00051     {
00052         bool first=true;
00053         FXString ret;
00054         for(const_iterator it=begin(); it!=end(); ++it)
00055         {
00056             if(!first) ret+=sep;
00057             ret+=*it;
00058             first=false;
00059         }
00060         return ret;
00061     }
00062 };
00063 
00064 } // namespace
00065 
00066 #endif

(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:31:26 2009 for TnFOX by doxygen v1.4.7