#####################################################################
#####################################################################
## Versavant Topic Map Application Bus / Subject Addressing Engine ##
## Copyright 2005 Steven R. Newcomb                                ##
##                                                                 ##
## This software is licensed under the Apache License, Version 2.0 ##
## (the "License"); you may not use this file except in compliance ##
## with the License.  Copies of the License are available at       ##
##        http://www.apache.org/licenses/LICENSE-2.0               ##
##                                                                 ##
## Unless required by applicable law or agreed to in writing,      ##
## software distributed under the License is distributed on an "AS ##
## IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either ##
## express or implied.  See the License for the specific language  ##
## governing permissions and limitations under the License.        ##
##                                                                 ##
## Copies of the source code and the license are available at      ##
##        http://www.versavant.org                                 ##
#####################################################################
#####################################################################

####################################
cvsRevision = "$Revision: 1.4 $" ##
####################################


##############################################
## This value type is for lists of strings. ##
##############################################

import types

#######################################################
def ValueIsNotOfType_stringSet_( vsv, propertyValue, propertyClass, propertyInstance = None):
    if not isinstance( propertyValue, types.ListType):
        vsv.errMsg( 'Value "%s" is not a list.' % propertyValue)
        return True
    for item in propertyValue:
        if not isinstance( item, types.StringType):
            vsv.errMsg( 'Item ("%s") in value "%s" is not a string.' % ( item, propertyValue))
            return True
    return False

#######################################################
def InstanceOf_stringSet_ValueTypeToXMLContentString( vsv, propertyInstance):
    return vsv.cPickleDumpObjectAsXMLContentString( propertyInstance._value)

#######################################################
def XMLContentStringToInstanceOf_stringSet_ValueType( vsv, string, propertyClass):
    return vsv.cPickleLoadObjectFromXMLContentString( string)

