00001 /******************************************************************************* 00002 * Copyright (c) 2006 International Business Machines Corporation 00003 * All rights reserved. This program and the accompanying materials 00004 * are made available under the terms of the Common Public License v1.0 00005 * which accompanies this distribution, and is available at 00006 * http://www.opensource.org/licenses/cpl1.0.php 00007 * 00008 * Contributors: 00009 * Douglas Sprague, Joel Wheeler - initial API and implementation 00010 * 00011 *****************************************************************************/ 00012 00013 #ifndef STILNameList_H 00014 #define STILNameList_H 00015 00016 #include "stilcom.h" 00017 #include "stilcomstr.h" 00018 #include <vector> 00019 00020 00021 //--------------------------------------------------------------------------- 00028 //--------------------------------------------------------------------------- 00029 class STILNameList { 00030 00031 public: 00032 00033 // - Default Constructor 00034 STILNameList(); 00035 00036 // - Copy Constructor 00037 STILNameList(const STILNameList&); 00038 00039 // - Destructor 00040 ~STILNameList(); 00041 00042 // - Assignment operator 00043 STILNameList & operator=(const STILNameList&); 00044 00045 // - Get the number of names in the current list 00046 LONG getCount() const; 00047 00048 // - Add a name to the list 00049 void addName (const sstring&); 00050 00051 // - Get the name at the ith position 00052 const sstring& getName(LONG) const; 00053 00054 // - Get a text representation of this 00055 sstring getText() const; 00056 00057 // - Write this out to a file 00058 virtual void write(FILE * pOutFile, LONG indentation=0) const; 00059 00060 00061 // - Initialize/reset this object 00062 void init(); 00063 00064 private: 00065 00066 // inverted names will can be saved as "!<name>" 00067 std::vector<sstring> m_nameList; 00068 00069 00070 }; // end class STILNameList 00071 00073 //-------------------------------------------------------------------------- 00081 //-------------------------------------------------------------------------- 00082 inline LONG STILNameList::getCount() const { return m_nameList.size(); } 00083 00084 //-------------------------------------------------------------------------- 00092 //-------------------------------------------------------------------------- 00093 inline const sstring& STILNameList::getName(LONG i) const { return m_nameList[i]; } 00094 00095 00096 #endif