Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ippStringBuilder.h

Go to the documentation of this file.
00001 // 
00002 // DISCLAIMER: 
00003 //  This software was produced by the National Institute of Standards 
00004 //  and Technology (NIST), an agency of the U.S. government, and by statute is 
00005 //  not subject to copyright in the United States.  Recipients of this 
00006 //  software assume all responsibility associated with its operation,
00007 //  modification,maintenance, and subsequent redistribution. 
00008 //
00009 //  See NIST Administration Manual 4.09.07 b and Appendix I. 
00010 #pragma once
00011 #include "ippdme/ippdme.h"
00012 #include "ippdme/ippChangeToolActionType.h"
00013 #include "ippdme/ippErrorNameType.h"
00014 #include "ippdme/ippCoordSysType.h"
00015 #include "ippdme/ippCommandNameType.h"
00016 #include "ippdme/ippMachineClassType.h"
00017 
00018 #include <string>
00019 class ippTag;
00020 class ippTargetVector;
00021 
00022 class IPPDME_EXT_CLASS ippStringBuilder
00023 {
00024 public:
00025   ippStringBuilder();
00026   
00027   // construct a string for a response string
00028   ippStringBuilder(const ippTag& tag,const char* marker);
00029 
00030   // construct a string for a command string
00031   ippStringBuilder(const ippTag& tag);
00032 
00033   // destructor
00034   virtual ~ippStringBuilder();
00035 
00036   // --- generic 
00037   void Append(const char*);
00038 
00039 
00040   std::string ToString() const;
00041 
00042   // ---- i++ specfic
00043   void StartFunc(const char* funcName);
00044   void StartFunc(ippCommandNameType type);
00045 
00046   void EndFunc();
00047   // str.StartFunc("G"); str.EndFunc(); produces : G();
00048 
00049   void AppendParam(int value);
00050   void AppendParam(double value);
00051   void AppendParam(const char* value);
00052   void AppendParam(const std::string& value){AppendParam(value.c_str());}
00053   void AppendParam(ippChangeToolActionType);
00054   void AppendParam(const ippErrorNameType& value);
00055   void AppendParam(ippCoordSysType value);
00056   void AppendParam(ippMachineClassType value);
00057 
00058   ippStringBuilder& AppendFunc(const char*function_name,const char* value);
00059   ippStringBuilder& AppendFunc(const char*function_name,const std::string& value){ return AppendFunc(function_name,value.c_str()); }
00060   ippStringBuilder& AppendFunc(const char*function_name,double value);
00061   ippStringBuilder& AppendFunc(const char*function_name,int value);
00062   ippStringBuilder& AppendFunc(const char*function_name,double v1,double v2,double v3);
00063   ippStringBuilder& AppendFunc(const char*function_name);
00064   ippStringBuilder& AppendFunc(const char*function_name,const ippErrorNameType&);
00065   ippStringBuilder& AppendFunc(const char*function_name,const ippTargetVector& v);
00066   ippStringBuilder& AppendFunc(const char*function_name,ippCoordSysType v);
00067   ippStringBuilder& AppendFunc(const char*function_name,ippMachineClassType v);
00068   
00069  
00070   // str.StartFunc("G"); str.AppendParam("F",1.0); str.AppendParam("F",1.0);
00071   // str.EndFunc(); produces : G(F(1.0),F(1.0))
00072 private:
00073   //
00074   char* _buffer;
00075   char* _cur;
00076   std::vector<int> _stack;
00077   //----
00078   ippStringBuilder(const ippStringBuilder&);
00079   void operator=(const ippStringBuilder&);
00080   void init();
00081   void new_argument();
00082 
00083 };

Generated on Wed Nov 8 00:19:58 2006 for IPPDME by  doxygen 1.4.1