summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-02-14 18:57:18 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-02-14 21:36:32 (GMT)
commitcb05f5a908e20006c954ce38755c2e422ecc2388 (patch)
treea793551a5fe279a57d4330119560e8542f745484 /Swiften/Parser/PayloadParsers/FormParser.h
parentcad974b45c0fb9355e68d9728e42c9ae3dbcebc7 (diff)
downloadswift-cb05f5a908e20006c954ce38755c2e422ecc2388.zip
swift-cb05f5a908e20006c954ce38755c2e422ecc2388.tar.bz2
Removed Swift::String.
Diffstat (limited to 'Swiften/Parser/PayloadParsers/FormParser.h')
-rw-r--r--Swiften/Parser/PayloadParsers/FormParser.h30
1 files changed, 15 insertions, 15 deletions
diff --git a/Swiften/Parser/PayloadParsers/FormParser.h b/Swiften/Parser/PayloadParsers/FormParser.h
index c41e27f..90a3550 100644
--- a/Swiften/Parser/PayloadParsers/FormParser.h
+++ b/Swiften/Parser/PayloadParsers/FormParser.h
@@ -14,15 +14,15 @@ namespace Swift {
public:
FormParser();
- virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes);
- virtual void handleEndElement(const String& element, const String&);
- virtual void handleCharacterData(const String& data);
+ virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes);
+ virtual void handleEndElement(const std::string& element, const std::string&);
+ virtual void handleCharacterData(const std::string& data);
private:
class FieldParseHelper {
public:
virtual ~FieldParseHelper() {}
- virtual void addValue(const String&) = 0;
+ virtual void addValue(const std::string&) = 0;
virtual boost::shared_ptr<FormField> getField() const {
return field;
}
@@ -30,15 +30,15 @@ namespace Swift {
boost::shared_ptr<FormField> field;
};
class BoolFieldParseHelper : public FieldParseHelper {
- virtual void addValue(const String& s) {
+ virtual void addValue(const std::string& s) {
boost::dynamic_pointer_cast< GenericFormField<bool> >(getField())->setValue(s == "1" || s == "true");
getField()->addRawValue(s);
}
};
class StringFieldParseHelper : public FieldParseHelper {
- virtual void addValue(const String& s) {
- boost::shared_ptr<GenericFormField<String> > field = boost::dynamic_pointer_cast< GenericFormField<String> >(getField());
- if (field->getValue().isEmpty()) {
+ virtual void addValue(const std::string& s) {
+ boost::shared_ptr<GenericFormField<std::string> > field = boost::dynamic_pointer_cast< GenericFormField<std::string> >(getField());
+ if (field->getValue().empty()) {
field->setValue(s);
}
else {
@@ -48,22 +48,22 @@ namespace Swift {
}
};
class JIDFieldParseHelper : public FieldParseHelper {
- virtual void addValue(const String& s) {
+ virtual void addValue(const std::string& s) {
boost::dynamic_pointer_cast< GenericFormField<JID> >(getField())->setValue(JID(s));
}
};
class StringListFieldParseHelper : public FieldParseHelper {
- virtual void addValue(const String& s) {
+ virtual void addValue(const std::string& s) {
// FIXME: Inefficient, but too much hassle to do efficiently
- boost::shared_ptr<GenericFormField< std::vector<String> > > field = boost::dynamic_pointer_cast< GenericFormField<std::vector<String > > >(getField());
- std::vector<String> l = field->getValue();
+ boost::shared_ptr<GenericFormField< std::vector<std::string> > > field = boost::dynamic_pointer_cast< GenericFormField<std::vector<std::string > > >(getField());
+ std::vector<std::string> l = field->getValue();
l.push_back(s);
field->setValue(l);
getField()->addRawValue(s);
}
};
class JIDListFieldParseHelper : public FieldParseHelper {
- virtual void addValue(const String& s) {
+ virtual void addValue(const std::string& s) {
// FIXME: Inefficient, but too much hassle to do efficiently
boost::shared_ptr< GenericFormField< std::vector<JID> > > field = boost::dynamic_pointer_cast< GenericFormField<std::vector<JID > > >(getField());
std::vector<JID> l = field->getValue();
@@ -104,8 +104,8 @@ namespace Swift {
FieldLevel = 2
};
int level_;
- String currentText_;
- String currentOptionLabel_;
+ std::string currentText_;
+ std::string currentOptionLabel_;
boost::shared_ptr<FieldParseHelper> currentFieldParseHelper_;
};
}