LCOV - code coverage report
Current view: top level - libreoffice/solver/unxlngi6.pro/inc/offapi/com/sun/star/rdf - URI.hpp (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 23 37 62.2 %
Date: 2012-12-17 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : #ifndef INCLUDED_COM_SUN_STAR_RDF_URI_HPP
       2             : #define INCLUDED_COM_SUN_STAR_RDF_URI_HPP
       3             : 
       4             : #include "sal/config.h"
       5             : 
       6             : #include <cassert>
       7             : 
       8             : #include "com/sun/star/uno/RuntimeException.hpp"
       9             : #include "com/sun/star/uno/Exception.hpp"
      10             : #include "com/sun/star/uno/DeploymentException.hpp"
      11             : #include "com/sun/star/uno/XComponentContext.hpp"
      12             : #include "com/sun/star/rdf/XURI.hpp"
      13             : #include "com/sun/star/lang/IllegalArgumentException.hpp"
      14             : #include "com/sun/star/uno/Any.hxx"
      15             : #include "com/sun/star/uno/Reference.hxx"
      16             : #include "com/sun/star/uno/Sequence.hxx"
      17             : #include "cppu/unotype.hxx"
      18             : #include "rtl/ustring.h"
      19             : #include "rtl/ustring.hxx"
      20             : #include "sal/types.h"
      21             : 
      22             : namespace com { namespace sun { namespace star { namespace rdf {
      23             : 
      24             : class URI {
      25             : public:
      26          37 :     static ::com::sun::star::uno::Reference< css::rdf::XURI > create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & the_context, const ::rtl::OUString& Value) {
      27             :         assert(the_context.is());
      28          37 :         ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > the_arguments(1);
      29          37 :         the_arguments[0] <<= Value;
      30          37 :         ::com::sun::star::uno::Reference< css::rdf::XURI > the_instance;
      31             :         try {
      32          37 :             the_instance = ::com::sun::star::uno::Reference< css::rdf::XURI >(the_context->getServiceManager()->createInstanceWithArgumentsAndContext(::rtl::OUString( "com.sun.star.rdf.URI" ), the_arguments, the_context), ::com::sun::star::uno::UNO_QUERY);
      33           0 :         } catch (::com::sun::star::uno::RuntimeException &) {
      34           0 :             throw;
      35           0 :         } catch (::com::sun::star::uno::Exception & the_exception) {
      36           0 :             throw ::com::sun::star::uno::DeploymentException(::rtl::OUString( "component context fails to supply service com.sun.star.rdf.URI of type com.sun.star.rdf.XURI: " ) + the_exception.Message, the_context);
      37             :         }
      38          37 :         if (!the_instance.is()) {
      39          36 :             throw ::com::sun::star::uno::DeploymentException(::rtl::OUString( "component context fails to supply service com.sun.star.rdf.URI of type com.sun.star.rdf.XURI" ), the_context);
      40             :         }
      41          37 :         return the_instance;
      42             :     }
      43             : 
      44           3 :     static ::com::sun::star::uno::Reference< css::rdf::XURI > createNS(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & the_context, const ::rtl::OUString& Namespace, const ::rtl::OUString& LocalName) {
      45             :         assert(the_context.is());
      46           3 :         ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > the_arguments(2);
      47           3 :         the_arguments[0] <<= Namespace;
      48           3 :         the_arguments[1] <<= LocalName;
      49           3 :         ::com::sun::star::uno::Reference< css::rdf::XURI > the_instance;
      50             :         try {
      51           3 :             the_instance = ::com::sun::star::uno::Reference< css::rdf::XURI >(the_context->getServiceManager()->createInstanceWithArgumentsAndContext(::rtl::OUString( "com.sun.star.rdf.URI" ), the_arguments, the_context), ::com::sun::star::uno::UNO_QUERY);
      52           0 :         } catch (::com::sun::star::uno::RuntimeException &) {
      53           0 :             throw;
      54           0 :         } catch (::com::sun::star::uno::Exception & the_exception) {
      55           0 :             throw ::com::sun::star::uno::DeploymentException(::rtl::OUString( "component context fails to supply service com.sun.star.rdf.URI of type com.sun.star.rdf.XURI: " ) + the_exception.Message, the_context);
      56             :         }
      57           3 :         if (!the_instance.is()) {
      58           0 :             throw ::com::sun::star::uno::DeploymentException(::rtl::OUString( "component context fails to supply service com.sun.star.rdf.URI of type com.sun.star.rdf.XURI" ), the_context);
      59             :         }
      60           3 :         return the_instance;
      61             :     }
      62             : 
      63           6 :     static ::com::sun::star::uno::Reference< css::rdf::XURI > createKnown(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & the_context, ::sal_Int16 Id) {
      64             :         assert(the_context.is());
      65           6 :         ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > the_arguments(1);
      66           6 :         the_arguments[0] <<= Id;
      67           6 :         ::com::sun::star::uno::Reference< css::rdf::XURI > the_instance;
      68             :         try {
      69           6 :             the_instance = ::com::sun::star::uno::Reference< css::rdf::XURI >(the_context->getServiceManager()->createInstanceWithArgumentsAndContext(::rtl::OUString( "com.sun.star.rdf.URI" ), the_arguments, the_context), ::com::sun::star::uno::UNO_QUERY);
      70           0 :         } catch (::com::sun::star::uno::RuntimeException &) {
      71           0 :             throw;
      72           0 :         } catch (::com::sun::star::uno::Exception & the_exception) {
      73           0 :             throw ::com::sun::star::uno::DeploymentException(::rtl::OUString( "component context fails to supply service com.sun.star.rdf.URI of type com.sun.star.rdf.XURI: " ) + the_exception.Message, the_context);
      74             :         }
      75           6 :         if (!the_instance.is()) {
      76           0 :             throw ::com::sun::star::uno::DeploymentException(::rtl::OUString( "component context fails to supply service com.sun.star.rdf.URI of type com.sun.star.rdf.XURI" ), the_context);
      77             :         }
      78           6 :         return the_instance;
      79             :     }
      80             : 
      81             : private:
      82             :     URI(); // not implemented
      83             :     URI(URI &); // not implemented
      84             :     ~URI(); // not implemented
      85             :     void operator =(URI); // not implemented
      86             : };
      87             : 
      88             : } } } }
      89             : 
      90             : #endif // INCLUDED_COM_SUN_STAR_RDF_URI_HPP

Generated by: LCOV version 1.10