COPASI API  4.16.103
CCopasiStaticString.cpp
Go to the documentation of this file.
1 /* Begin CVS Header
2  $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/report/CCopasiStaticString.cpp,v $
3  $Revision: 1.13 $
4  $Name: $
5  $Author: shoops $
6  $Date: 2006/04/27 01:31:09 $
7  End CVS Header */
8 
9 // Copyright 2005 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc. and EML Research, gGmbH.
11 // All rights reserved.
12 
13 #include "copasi.h"
14 
15 #include <sstream>
16 #include "CCopasiStaticString.h"
17 #include "CCopasiObjectName.h"
18 
20  const CCopasiContainer * pParent,
21  const std::string & type,
22  const unsigned C_INT32 & flag):
23  CCopasiObject(name, pParent, type, flag | CCopasiObject::StaticString),
24  mStaticString(name)
25 {}
26 
28  const CCopasiContainer * pParent):
29  CCopasiObject(src, pParent),
30  mStaticString(src.mStaticString)
31 {}
32 
34 
36 {
37  mStaticString = rhs;
39  return *this;
40 }
41 
42 void CCopasiStaticString::print(std::ostream * ostream) const
43  {(*ostream) << mStaticString;}
44 
45 std::string CCopasiStaticString::getObjectDisplayName(bool C_UNUSED(regular) /*=true*/,
46  bool C_UNUSED(richtext) /*=false*/) const
47  {
48  if (mStaticString == "\n")
49  return "<linebreak>";
50 
51  return "'" + mStaticString + "'";
52  }
53 
54 const std::string & CCopasiStaticString::getStaticString() const
55 {return mStaticString;}
56 
58  const CCopasiContainer * pParent):
59  CCopasiStaticString(name, pParent, "Separator", CCopasiObject::Separator)
60 {}
61 
63  const CCopasiContainer * pParent):
64  CCopasiStaticString(src, pParent)
65 {}
66 
68 
69 std::string CCopasiReportSeparator::getObjectDisplayName(bool C_UNUSED(regular) /*=true*/,
70  bool C_UNUSED(richtext) /*=false*/) const
71  {return getObjectType();}
72 
74 {
75  * (CCopasiStaticString *) this = rhs;
76  return *this;
77 }
virtual std::string getObjectDisplayName(bool regular=true, bool richtext=false) const
virtual std::string getObjectDisplayName(bool regular=true, bool richtext=false) const
const std::string & getObjectType() const
#define C_UNUSED(p)
Definition: copasi.h:220
#define C_INT32
Definition: copasi.h:90
virtual void print(std::ostream *ostream) const
const std::string & getStaticString() const
CCopasiStaticString & operator=(const std::string &rhs)
CCopasiReportSeparator & operator=(const std::string &rhs)
CCopasiStaticString(const std::string &name="", const CCopasiContainer *pParent=NULL, const std::string &type="String", const unsigned C_INT32 &flag=CCopasiObject::StaticString)
long int flag
Definition: f2c.h:52
bool setObjectName(const std::string &name)
CCopasiReportSeparator(const std::string &name="", const CCopasiContainer *pParent=NULL)