|
ximol/xml/attributes.hpp File Reference
Detailed Description
attributes declaration.
- Author:
- Tournois Florent
- Version:
- 1.0
- Id
- attributes.hpp,v 1.20 2004/02/25 18:59:13 tournois Exp
- Log
- attributes.hpp,v
Revision 1.20 2004/02/25 18:59:13 tournois imporve the gcc compatibility.
Revision 1.19 2004/02/22 22:36:24 hfp empty log message ***
Revision 1.18 2004/02/22 10:27:34 tournois Add some doc.
Revision 1.17 2004/02/22 09:54:21 tournois Change years on the copyright.
Revision 1.16 2004/02/19 18:59:28 tournois attribute doc
Revision 1.15 2004/01/29 20:52:35 tournois doc and tutorial.
Revision 1.14 2004/01/18 11:40:58 tournois Add the pattern facet.
Revision 1.13 2003/12/10 20:45:51 tournois no message
Revision 1.12 2003/12/09 19:57:28 tournois Fix some bugs about attributes classes.
Revision 1.11 2003/12/05 13:04:41 hfp adapt supplied functions
Revision 1.10 2003/12/04 14:44:10 hfp shortcut/uri-mapping includes default namespace ns_map swaps key with value -> faster find for main use-case throwing error in some cases interface is based on map (insert, fiind) mis-use of special values on return removed (find etc.) size() returns an size_t (unsigned)
Revision 1.9 2003/12/03 12:28:46 hfp swap, copy construction and assignment
Revision 1.8 2003/11/19 20:52:54 tournois Add new manipulator for stag and etag. Correct bugs and add tests.
Revision 1.7 2003/11/18 18:54:52 tournois Add str_cast and drop the transformation.hpp file.
Revision 1.6 2003/11/15 22:52:57 tournois Add somes function arround attributes and tests for attributes.
Revision 1.5 2003/11/14 13:30:20 tournois change the attributes class and fix some bugs.
Revision 1.4 2003/11/02 19:23:01 tournois Go to the boost coding standard. Change all name to lower case.
Revision 1.3 2003/10/25 13:53:40 hfp review and separation
Revision 1.2 2003/09/28 16:46:13 hfp The "uri" default argument of the add()-method has changed the construction of default-value (::str::string() -> xstring()), because of non-existing conversion path from string to xstring.
Revision 1.1 2003/09/24 08:28:18 tournois Create the namespace Encoders, Parser, Xml Change the library organization. add VC7.1 project for this organization.
Definition in file attributes.hpp.
#include <ximol/stop_warnings.hpp>
#include <ximol/export_defs.hpp>
#include <ximol/str_cast.hpp>
#include <ximol/typedefs.hpp>
#include <map>
Include dependency graph for attributes.hpp:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
|
Classes |
class | attributes |
| A simple class to contain attributes of a tag. More...
|
struct | extract_attribute |
| Deserialize the attribute from the name. More...
|
struct | extract_attribute< std::string > |
| Deserialize the attribute from the name. More...
|
struct | extract_attribute< std::wstring > |
| Deserialize the attribute from the name. More...
|
Functions |
xostream & | operator<< (xostream &xos, attributes const &rhs) |
| put to operator for attributes
|
xistream & | operator>> (xistream &xis, attributes &rhs) |
| get from operator for attributes
|
XIMOL_EXPORT::std::ostream & | operator<< (::std::ostream &os, attributes const &x) |
| put to operator for attributes on standard stream
|
template<typename StringT1, typename StringT2, typename T> XIMOL_XML_END_NAMESPACE XIMOL_BEGIN_NAMESPACE
std::pair< xml::attributes::iterator,
bool > | insert_attribute (xml::attributes &att, StringT1 const &namespace_name, StringT2 const &name, T const &value) |
| insert an attribute insert a attribute in the attribute list.
|
template<typename StringT, typename T> std::pair< xml::attributes::iterator,
bool > | insert_attribute (xml::attributes &att, StringT const &name, T const &value) |
| insert an attribute insert a attribute in the attribute list.
|
template<typename StringT1, typename StringT2, typename T> void | set_attribute (xml::attributes &att, StringT1 const &namespace_name, StringT2 const &name, T const &value) |
| set an attribute
|
template<typename StringT, typename T> void | set_attribute (xml::attributes &att, StringT const &name, T const &value) |
| set an xml::attributes
|
template<typename StringT1, typename StringT2, typename T> bool | get_attribute (xml::attributes const &att, StringT1 const &namespace_name, StringT2 const &name, T &value) |
| Deserialize the attribute value.
|
template<typename StringT, typename T> bool | get_attribute (xml::attributes const &att, StringT const &name, T &value) |
| Deserialize the attribute from the name.
|
template<typename StringT1, typename StringT2> xstring | get_raw_attribute (xml::attributes const &att, StringT1 const &namespace_name, StringT2 const &name) |
| Deserialize the attribute from the name.
|
template<typename StringT> xstring | get_raw_attribute (xml::attributes const &att, StringT const &name) |
| Deserialize the attribute from the name.
|
template<typename String1, typename String2> bool | set_namespace (xml::attributes &att, String1 &short_namespace, const String2 &uri) |
| define a short_namespace for an uri.
|
template<typename String> void | set_namespace (xml::attributes &att, const String &uri) |
| define the default namespace.
|
template<typename String> xstring | get_namespace (xml::attributes &att, String &short_namespace) |
| Get the uri from the short namespace.
|
xstring | get_namespace (xml::attributes &att) |
| get the default namespace.
|
template<typename String> xstring | get_short_namespace (xml::attributes &att, String &uri) |
| get the uri from the short namespace.
|
Variables |
XIMOL_BEGIN_NAMESPACE class | xistream |
Function Documentation
template<typename StringT, typename T> |
bool get_attribute |
( |
xml::attributes const & |
att, |
|
|
StringT const & |
name, |
|
|
T & |
value |
|
) |
|
|
template<typename StringT1, typename StringT2, typename T> |
bool get_attribute |
( |
xml::attributes const & |
att, |
|
|
StringT1 const & |
namespace_name, |
|
|
StringT2 const & |
name, |
|
|
T & |
value |
|
) |
|
|
|
Deserialize the attribute value.
- Parameters:
-
value |
Type requirements: copy constructable, serializable. T doesn't need to be default constructable. |
- Examples:
-
tutorial_attribute.cpp.
Definition at line 383 of file attributes.hpp. |
template<typename StringT1, typename StringT2> |
xstring get_raw_attribute |
( |
xml::attributes const & |
att, |
|
|
StringT1 const & |
namespace_name, |
|
|
StringT2 const & |
name |
|
) |
|
|
|
get the uri from the short namespace.
This template version call the internal function of the xml::attributes.
- Parameters:
-
- Returns:
- the short namespace or the uri (in input) if the short namespace is not found.
- Examples:
-
tutorial_attribute.cpp.
Definition at line 571 of file attributes.hpp.
References xstring. |
XIMOL_EXPORT ::std::ostream& operator<< |
( |
::std::ostream & |
os, |
|
|
attributes const & |
x |
|
) |
|
|
template<typename StringT, typename T> |
void set_attribute |
( |
xml::attributes & |
att, |
|
|
StringT const & |
name, |
|
|
T const & |
value |
|
) |
|
|
template<typename StringT1, typename StringT2, typename T> |
void set_attribute |
( |
xml::attributes & |
att, |
|
|
StringT1 const & |
namespace_name, |
|
|
StringT2 const & |
name, |
|
|
T const & |
value |
|
) |
|
|
template<typename String> |
void set_namespace |
( |
xml::attributes & |
att, |
|
|
const String & |
uri |
|
) |
|
|
|
define the default namespace.
- Parameters:
-
Definition at line 526 of file attributes.hpp. |
template<typename String1, typename String2> |
bool set_namespace |
( |
xml::attributes & |
att, |
|
|
String1 & |
short_namespace, |
|
|
const String2 & |
uri |
|
) |
|
|
Variable Documentation
|
|