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 STILWFCSITEM_H 00014 #define STILWFCSITEM_H 00015 00016 #include "stilcom.h" 00017 #include "stilcomstr.h" 00018 #include "stilentity.h" 00019 00020 //--------------------------------------------------------------------------- 00043 //--------------------------------------------------------------------------- 00044 class STILWFCSItem : public STILEntity { 00045 00046 public : 00047 // - Escape sequence attribute 00048 enum STILESC_TYPE { 00049 Undefined, 00050 WFC, 00051 Repeat, 00052 Hex, 00053 HexLocal, 00054 Dec, 00055 DecLocal, 00056 DBC 00057 }; 00058 00059 // - Default constructor 00060 STILWFCSItem(); 00061 00062 // - Copy constructor 00063 STILWFCSItem(const STILWFCSItem&); 00064 00065 // - Destructor 00066 virtual ~STILWFCSItem(); 00067 00068 // - Assignment Operator 00069 STILWFCSItem & operator=(const STILWFCSItem &); 00070 00071 // - Init/reset an object 00072 void init(); 00073 00074 // - Set/Get the escape type 00075 void setEscapeType (const STILESC_TYPE& et); 00076 STILESC_TYPE getEscapeType () const; 00077 00078 // - Set/Get the repeat count 00079 void setRepeatCount(const LONG& i); 00080 LONG getRepeatCount(void); 00081 00082 // - Expand repeated WFCs and return the expanded 00083 const sstring expandRepeat (void) const; 00084 00085 private : 00086 // - Hold the escape type (/r, /w, etc) 00087 STILESC_TYPE m_escType; 00088 00089 // - The repeat count (default = -1) 00090 LONG m_rc; 00091 00092 }; 00093 00094 //-------------------------------------------------------------------------- 00102 //------------------------------------------------------------------------- 00103 inline void STILWFCSItem::setEscapeType (const STILESC_TYPE& et) { m_escType = et; } 00104 00105 //-------------------------------------------------------------------------- 00113 //------------------------------------------------------------------------- 00114 inline STILWFCSItem::STILESC_TYPE STILWFCSItem::getEscapeType () const { return m_escType; } 00115 00116 //-------------------------------------------------------------------------- 00124 //------------------------------------------------------------------------- 00125 // - Set/Get the repeat count 00126 inline void STILWFCSItem::setRepeatCount(const LONG& i) { m_rc = i; } 00127 00128 //-------------------------------------------------------------------------- 00136 //------------------------------------------------------------------------- 00137 inline LONG STILWFCSItem::getRepeatCount(void) { return m_rc; } 00138 00139 #endif