//******************************************************************* // Copyright (C) 2000 ImageLinks Inc. // // LICENSE: MIT see top level license.txt // // Author: Garrett Potts (gpotts@imagelinks.com) // //************************************************************************* // $Id: ossimStringProperty.h 23666 2015-12-14 20:01:22Z rashadkm $ #ifndef ossimStringProperty_HEADER #define ossimStringProperty_HEADER #include #include class OSSIMDLLEXPORT ossimStringProperty : public ossimProperty { public: ossimStringProperty(const ossimString& name = ossimString(""), const ossimString& value = ossimString(""), bool editableFlag = true, const std::vector& constraintList = std::vector()); ossimStringProperty(const ossimStringProperty& rhs); /*! * Duplicates the object and returns a new one */ virtual ossimObject* dup()const; virtual const ossimProperty& assign(const ossimProperty& rhs); void setEditableFlag(bool flag); bool getEditableFlag()const; bool isEditable()const; /*! * Clears the constraints for this string. You can constrain * it to a string list by calling setConstraints. */ void clearConstraints(); /*! * Sets the constraints for this property. If the editable * flag is present then this says the editing is not readonly * and one can hand type the value in without only selecting * from a choice list. */ void setConstraints(const std::vector& constraintList); void addConstraint(const ossimString& value); const std::vector& getConstraints()const; bool hasConstraints()const; /*! * will try to set the value. If the constraints are set * it will make sure that the value is in the list and * if its not then it will return false */ virtual bool setValue(const ossimString& value); virtual void valueToString(ossimString& valueResult)const; protected: ossimString theValue; bool theEditableFlag; std::vector theConstraints; TYPE_DATA }; #endif