LCOV - code coverage report
Current view: top level - xsd/cxx/xml - qualified-name.hxx (source / functions) Hit Total Coverage
Test: lcov-run.info Lines: 2 5 40.0 %
Date: 2019-02-15 00:00:25 Functions: 1 2 50.0 %
Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : // file      : xsd/cxx/xml/qualified-name.hxx
       2                 :            : // copyright : Copyright (c) 2005-2014 Code Synthesis Tools CC
       3                 :            : // license   : GNU GPL v2 + exceptions; see accompanying LICENSE file
       4                 :            : 
       5                 :            : #ifndef XSD_CXX_XML_QUALIFIED_NAME_HXX
       6                 :            : #define XSD_CXX_XML_QUALIFIED_NAME_HXX
       7                 :            : 
       8                 :            : #include <string>
       9                 :            : 
      10                 :            : namespace xsd
      11                 :            : {
      12                 :            :   namespace cxx
      13                 :            :   {
      14                 :            :     namespace xml
      15                 :            :     {
      16                 :            :       template <typename C>
      17                 :         10 :       struct qualified_name
      18                 :            :       {
      19                 :            :         qualified_name (const C* name,
      20                 :            :                         const C* namespace_)
      21                 :            :             : name_ (name), namespace__ (namespace_)
      22                 :            :         {
      23                 :            :         }
      24                 :            : 
      25                 :          0 :         qualified_name (const std::basic_string<C>& name,
      26                 :            :                         const std::basic_string<C>& namespace_)
      27                 :          0 :             : name_ (name), namespace__ (namespace_)
      28                 :            :         {
      29                 :          0 :         }
      30                 :            : 
      31                 :            :         qualified_name (const C* name)
      32                 :            :             : name_ (name)
      33                 :            :         {
      34                 :            :         }
      35                 :            : 
      36                 :            :         qualified_name (const std::basic_string<C>& name)
      37                 :         10 :             : name_ (name)
      38                 :            :         {
      39                 :            :         }
      40                 :            : 
      41                 :            :         const std::basic_string<C>&
      42                 :            :         name () const
      43                 :            :         {
      44                 :            :           return name_;
      45                 :            :         }
      46                 :            : 
      47                 :            :         const std::basic_string<C>&
      48                 :            :         namespace_ () const
      49                 :            :         {
      50                 :            :           return namespace__;
      51                 :            :         }
      52                 :            : 
      53                 :            :       private:
      54                 :            :         std::basic_string<C> name_;
      55                 :            :         std::basic_string<C> namespace__;
      56                 :            :       };
      57                 :            : 
      58                 :            :       template <typename C>
      59                 :            :       inline bool
      60                 :            :       operator== (const qualified_name<C>& x, const qualified_name<C>& y)
      61                 :            :       {
      62                 :            :         return x.name () == y.name () && x.namespace_ () == y.namespace_ ();
      63                 :            :       }
      64                 :            : 
      65                 :            :       template <typename C>
      66                 :            :       inline bool
      67                 :            :       operator!= (const qualified_name<C>& x, const qualified_name<C>& y)
      68                 :            :       {
      69                 :            :         return !(x == y);
      70                 :            :       }
      71                 :            : 
      72                 :            :       template <typename C>
      73                 :            :       inline bool
      74                 :            :       operator< (const qualified_name<C>& x, const qualified_name<C>& y)
      75                 :            :       {
      76                 :            :         int r (x.name ().compare (y.name ()));
      77                 :            :         return (r < 0) || (r == 0 && x.namespace_ () < y.namespace_ ());
      78                 :            :       }
      79                 :            :     }
      80                 :            :   }
      81                 :            : }
      82                 :            : 
      83                 :            : #endif // XSD_CXX_XML_QUALIFIED_NAME_HXX

Generated by: LCOV version 1.12