~ubuntu-branches/ubuntu/natty/libxml++2.6/natty

« back to all changes in this revision

Viewing changes to libxml++/nodes/contentnode.cc

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-09-18 11:32:24 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20070918113224-7x031mzf1shoozxx
Tags: 2.20.0-0ubuntu1
* New upstream release:
  - Element: Added get_attribute_value(), to get a simple text value for an
    attribute.
  - Added an experimental --enable-api-exceptions configure option, to allow
    libxml++ to build without exceptions.
* debian/libxml++2.6-doc.docs: 2.18 -> 2.20.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
Glib::ustring ContentNode::get_content() const
23
23
{
24
24
  if(cobj()->type == XML_ELEMENT_NODE)
 
25
  {
 
26
    #ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
25
27
    throw internal_error("this node type doesn't have content");
 
28
    #else
 
29
    return Glib::ustring();
 
30
    #endif //LIBXMLCPP_EXCEPTIONS_ENABLED
 
31
  }
26
32
 
27
33
  return cobj()->content ? (char*)cobj()->content : "";
28
34
}
30
36
void ContentNode::set_content(const Glib::ustring& content)
31
37
{
32
38
   if(cobj()->type == XML_ELEMENT_NODE)
33
 
      throw internal_error("can't set content for this node type");
 
39
   {
 
40
     #ifdef LIBXMLCPP_EXCEPTIONS_ENABLED
 
41
     throw internal_error("can't set content for this node type");
 
42
     #else
 
43
     return;
 
44
     #endif //LIBXMLCPP_EXCEPTIONS_ENABLED
 
45
   }
 
46
      
34
47
 
35
48
   xmlNodeSetContent(cobj(), (xmlChar*)content.c_str());
36
49
}