summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2018-01-26 15:53:25 +0100
committerJohnny Willemsen <jwillemsen@remedy.nl>2018-01-26 15:53:25 +0100
commitd32216e0244b969acfffa4776073637519ceaa02 (patch)
tree04bc3563a477a727434bc73d7dcbb640037b6a69
parent9da59f9347aca3bd71a291b0a4b0b24666a82004 (diff)
downloadATCD-d32216e0244b969acfffa4776073637519ceaa02.tar.gz
Pull in latest version from XSC which adds a new operation and provides some more information when an error occurs
* ACE/ace/XML_Utils/XMLSchema/id_map.hpp:
-rw-r--r--ACE/ace/XML_Utils/XMLSchema/id_map.hpp29
1 files changed, 27 insertions, 2 deletions
diff --git a/ACE/ace/XML_Utils/XMLSchema/id_map.hpp b/ACE/ace/XML_Utils/XMLSchema/id_map.hpp
index 2803a5a85be..91c543cd997 100644
--- a/ACE/ace/XML_Utils/XMLSchema/id_map.hpp
+++ b/ACE/ace/XML_Utils/XMLSchema/id_map.hpp
@@ -54,7 +54,18 @@
//Unresolved_IDREF thrown when there are IDREF's in the
//XML document.
- class Unresolved_IDREF {};
+ class Unresolved_IDREF {
+ public:
+ Unresolved_IDREF(std::basic_string<ACE_TCHAR> &message) : message(message)
+ {}
+ ~Unresolved_IDREF(){}
+ std::basic_string<ACE_TCHAR> get_message ( void )
+ {
+ return message;
+ }
+ private:
+ std::basic_string<ACE_TCHAR> message;
+ };
//Only a default constructor and destructor are needed
//Constructor
@@ -95,6 +106,19 @@
return;
}
+ void resolve_single_idref (std::basic_string<ACE_TCHAR> idref, ::XSCRT::Type * element)
+ {
+ ID_Map::id_iterator id_iterator = this->id_map_.find(idref);
+ if (id_iterator != this->id_map_.end())
+ {
+ element->set_idref(idref, id_iterator->second);
+ }
+ else
+ {
+ throw Unresolved_IDREF(idref);
+ }
+ }
+
//Sets the referencing elements XSCRT::Type::idref_ to point to the
//referenced element.
//Note: The pointer is of type "XSCRT::Type*"
@@ -119,7 +143,8 @@
}
else
{
- //throw Unresolved_IDREF();
+ std::basic_string<ACE_TCHAR> temp (idref_iterator->first);
+ throw Unresolved_IDREF(temp);
}
}
}