App::PropertyStringList Class Reference

#include <PropertyStandard.h>

Inheritance diagram for App::PropertyStringList:
App::PropertyLists App::Property Base::Persistence Base::BaseClass

List of all members.

Public Member Functions

virtual PropertyCopy (void) const
 Returns a new copy of the property (mainly for Undo/Redo and transactions).
virtual const char * getEditorName (void) const
 Get the class name of the associated property editor item.
virtual unsigned int getMemSize (void) const
 This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB? This method is defined in Base::Persistence.
virtual PyObjectgetPyObject (void)
 This method returns the Python wrapper for a C++ object.
virtual int getSize (void) const
virtual Base::Type getTypeId (void) const
const std::vector< std::string > & getValues (void) const
const std::string & operator[] (const int idx) const
 index operator
virtual void Paste (const Property &from)
 PropertyStringList ()
 A constructor.
virtual void Restore (Base::XMLReader &reader)
 This method is used to restore properties from an XML document.
virtual void Save (Base::Writer &writer) const
 This method is used to save properties to an XML document.
void set1Value (const int idx, const std::string &value)
virtual void setPyObject (PyObject *)
virtual void setSize (int newSize)
void setValue (const std::string &)
 Sets the property.
void setValues (const std::list< std::string > &)
void setValues (const std::vector< std::string > &)
 ~PropertyStringList ()
 A destructor.

Static Public Member Functions

static void * create (void)
static Base::Type getClassTypeId (void)
static void init (void)

Detailed Description

Definition at line 507 of file PropertyStandard.h.


Constructor & Destructor Documentation

PropertyStringList::PropertyStringList (  ) 

A constructor.

A more elaborate description of the constructor.

Definition at line 1152 of file PropertyStandard.cpp.

Referenced by Copy().

PropertyStringList::~PropertyStringList (  ) 

A destructor.

A more elaborate description of the destructor.

Definition at line 1157 of file PropertyStandard.cpp.


Member Function Documentation

Property * PropertyStringList::Copy ( void   )  const [virtual]

Returns a new copy of the property (mainly for Undo/Redo and transactions).

Implements App::Property.

Definition at line 1289 of file PropertyStandard.cpp.

References draftTools::p, and PropertyStringList().

void * App::PropertyStringList::create ( void   )  [static]

Reimplemented from App::PropertyLists.

Definition at line 1150 of file PropertyStandard.cpp.

Base::Type App::PropertyStringList::getClassTypeId ( void   )  [static]

Reimplemented from App::PropertyLists.

Definition at line 1150 of file PropertyStandard.cpp.

Referenced by Gui::PropertyEditor::PropertyStringListItem::value().

virtual const char* App::PropertyStringList::getEditorName ( void   )  const [inline, virtual]

Get the class name of the associated property editor item.

Reimplemented from App::Property.

Definition at line 541 of file PropertyStandard.h.

unsigned int PropertyStringList::getMemSize ( void   )  const [virtual]

This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB? This method is defined in Base::Persistence.

See also:
Base::Persistence

Reimplemented from App::Property.

Definition at line 1250 of file PropertyStandard.cpp.

References getSize().

PyObject * PropertyStringList::getPyObject ( void   )  [virtual]

This method returns the Python wrapper for a C++ object.

It's in the responsibility of the programmer to do the correct reference counting. Basically there are two ways how to implement that: Either always return a new Python object then reference counting is not a matter or return always the same Python object then the reference counter must be incremented by one. However, it's absolutely forbidden to return always the same Python object without incrementing the reference counter.

The default implementation returns 'None'.

Reimplemented from Base::BaseClass.

Definition at line 1198 of file PropertyStandard.cpp.

References getSize().

int PropertyStringList::getSize ( void   )  const [virtual]

Implements App::PropertyLists.

Definition at line 1170 of file PropertyStandard.cpp.

Referenced by getMemSize(), getPyObject(), and Save().

Base::Type App::PropertyStringList::getTypeId ( void   )  const [virtual]

Reimplemented from App::PropertyLists.

Definition at line 1150 of file PropertyStandard.cpp.

const std::vector<std::string>& App::PropertyStringList::getValues ( void   )  const [inline]

Definition at line 539 of file PropertyStandard.h.

void App::PropertyStringList::init ( void   )  [static]

Reimplemented from App::PropertyLists.

Definition at line 1150 of file PropertyStandard.cpp.

const std::string& App::PropertyStringList::operator[] ( const int  idx  )  const [inline]

index operator

Definition at line 535 of file PropertyStandard.h.

void PropertyStringList::Paste ( const Property from  )  [virtual]
void PropertyStringList::Restore ( Base::XMLReader  )  [virtual]

This method is used to restore properties from an XML document.

It uses the XMLReader class, which bases on SAX, to read the in Save() written information. Again the Vector as an example:

 void PropertyVector::Restore(Base::XMLReader &reader)
 {
   // read my Element
   reader.readElement("PropertyVector");
   // get the value of my Attribute
   _cVec.x = (float)reader.getAttributeAsFloat("valueX");
   _cVec.y = (float)reader.getAttributeAsFloat("valueY");
   _cVec.z = (float)reader.getAttributeAsFloat("valueZ");
 }

Implements Base::Persistence.

Definition at line 1270 of file PropertyStandard.cpp.

References RobotExampleTrajectoryOutOfShapes::count, Base::XMLReader::getAttribute(), Base::XMLReader::getAttributeAsInteger(), Base::XMLReader::readElement(), Base::XMLReader::readEndElement(), and setValues().

void PropertyStringList::Save ( Base::Writer  )  const [virtual]

This method is used to save properties to an XML document.

A good example you'll find in PropertyStandard.cpp, e.g. the vector:

  void PropertyVector::Save (Writer &writer) const
  {
     writer << writer.ind() << "<PropertyVector valueX=\"" <<  _cVec.x <<
                                            "\" valueY=\"" <<  _cVec.y <<
                                            "\" valueZ=\"" <<  _cVec.z <<"\"/>" << endl;
  }

The writer.ind() expression writes the indention, just for pretty printing of the XML. As you see, the writing of the XML document is not done with a DOM implementation because of performance reasons. Therefore the programmer has to take care that a valid XML document is written. This means closing tags and writing UTF-8.

See also:
Base::Writer

Implements Base::Persistence.

Definition at line 1258 of file PropertyStandard.cpp.

References Base::Writer::decInd(), App::Property::encodeAttribute(), getSize(), Base::Writer::incInd(), Base::Writer::ind(), and Base::Writer::Stream().

void App::PropertyStringList::set1Value ( const int  idx,
const std::string &  value 
) [inline]

Definition at line 537 of file PropertyStandard.h.

void PropertyStringList::setPyObject ( PyObject value  )  [virtual]

Reimplemented from Base::BaseClass.

Definition at line 1214 of file PropertyStandard.cpp.

References draftlibs::dxfReader::error(), setValue(), and setValues().

void PropertyStringList::setSize ( int  newSize  )  [virtual]

Implements App::PropertyLists.

Definition at line 1165 of file PropertyStandard.cpp.

void PropertyStringList::setValue ( const std::string &  lValue  ) 

Sets the property.

Definition at line 1175 of file PropertyStandard.cpp.

References App::Property::aboutToSetValue(), and App::Property::hasSetValue().

Referenced by setPyObject().

void PropertyStringList::setValues ( const std::list< std::string > &  lValue  ) 
void PropertyStringList::setValues ( const std::vector< std::string > &  lValue  ) 

The documentation for this class was generated from the following files:

Generated on Wed Nov 23 19:01:45 2011 for FreeCAD by  doxygen 1.6.1