File: xml_parser_kernel_c.h

package info (click to toggle)
mldemos 0.5.1-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 32,224 kB
  • ctags: 46,525
  • sloc: cpp: 306,887; ansic: 167,718; ml: 126; sh: 109; makefile: 2
file content (64 lines) | stat: -rw-r--r-- 1,710 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Copyright (C) 2003  Davis E. King (davis@dlib.net)
// License: Boost Software License   See LICENSE.txt for the full license.
#ifndef DLIB_XML_PARSER_KERNEL_C_
#define DLIB_XML_PARSER_KERNEL_C_

#include "xml_parser_kernel_abstract.h"
#include <string>
#include <iostream>
#include "../algs.h"
#include "../assert.h"

namespace dlib
{

    template <
        typename xml_parser_base
        >
    class xml_parser_kernel_c : public xml_parser_base 
    {
        public:
            void parse (
                std::istream& in
            );
    };


    template < 
        typename xml_parser_base
        >
    inline void swap (
        xml_parser_kernel_c<xml_parser_base>& a, 
        xml_parser_kernel_c<xml_parser_base>& b 
    ) { a.swap(b); }   

// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
    // member function definitions
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------


    template <
        typename xml_parser_base
        >
    void xml_parser_kernel_c<xml_parser_base>:: 
    parse (
        std::istream& in
    )
    {
        DLIB_CASSERT ( in.fail() == false ,
            "\tvoid xml_parser::parse"
            << "\n\tthe input stream must not be in the fail state"
            << "\n\tthis: " << this
            );

        return xml_parser_base::parse(in);
    }

// ----------------------------------------------------------------------------------------

}

#endif // DLIB_XML_PARSER_KERNEL_C_