]> git.sur5r.net Git - openldap/blob - contrib/ldapc++/src/LdifReader.h
3b6c72173f3f81213dad3e9016345cb6e2412534
[openldap] / contrib / ldapc++ / src / LdifReader.h
1 /*
2  * Copyright 2008, OpenLDAP Foundation, All Rights Reserved.
3  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
4  */
5
6 #ifndef LDIF_READER_H
7 #define LDIF_READER_H
8
9 #include <LDAPEntry.h>
10 #include <iosfwd>
11 #include <list>
12
13 typedef std::list< std::pair<std::string, std::string> > LdifRecord;
14 class LdifReader
15 {
16     public:
17         LdifReader( std::istream &input );
18         int readNextRecord();
19         LDAPEntry getEntryRecord();
20
21     private:
22         int getLdifLine(std::string &line);
23
24         int splitLine(const std::string& line, 
25                     std::string &type,
26                     std::string &value );
27
28         std::string readIncludeLine( const std::string &line) const;
29
30         std::istream &m_ldifstream;
31         LdifRecord m_currentRecord;
32         int m_curRecType;
33 };
34
35 #endif /* LDIF_READER_H */