1 #include "StringType.h"
11 StringType::StringType()
16 StringType::StringType(std::string pattern)
18 this->pattern = pattern;
22 StringType::StringType(std::string pattern, std::string mimeType, Range* length)
24 this->pattern = pattern;
25 this->mimeType = mimeType;
26 this->length = length;
29 StringType::~StringType()
37 std::string StringType::getPattern()
42 void StringType::setPattern(std::string pattern)
44 this->pattern = pattern;
47 std::string StringType::getMimeType()
52 void StringType::setMimeType(std::string mimeType)
54 this->mimeType = mimeType;
57 Range* StringType::getLength()
62 void StringType::setLength(Range* length)
64 this->length = length;
67 int StringType::minLength()
69 if(length == NULL) return 0;
71 return length->getLower()->getInteger(INT_MAX);
74 int StringType::maxLength()
76 if(length == NULL) return INT_MAX;
78 return length->getUpper()->getInteger(INT_MIN);
81 std::string StringType::writeOut(int /*indent*/)
87 bool parenthesis = false;
89 if(mimeType.size() > 0)
91 s += "(mimeType=\"" + mimeType + "\"";
96 if(pattern.size() > 0)
98 if(parenthesis == false)
107 s += "pattern=\"" + pattern + "\"";
112 if(parenthesis == true)