]> git.sur5r.net Git - openldap/blobdiff - contrib/ldapc++/src/LdifReader.h
Merge remote-tracking branch 'origin/mdb.master'
[openldap] / contrib / ldapc++ / src / LdifReader.h
index 3b6c72173f3f81213dad3e9016345cb6e2412534..9a5c70953011c00d76c1623f497f7f67a0ce4818 100644 (file)
@@ -1,5 +1,6 @@
+// $OpenLDAP$
 /*
- * Copyright 2008, OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 2008-2012 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 
@@ -15,21 +16,42 @@ class LdifReader
 {
     public:
         LdifReader( std::istream &input );
-        int readNextRecord();
+
+        inline bool isEntryRecords() const
+        {
+            return !m_ldifTypeRequest;
+        }
+
+        inline bool isChangeRecords() const
+        {
+            return m_ldifTypeRequest;
+        }
+
+        inline int getVersion() const
+        {
+            return m_version;
+        }
+
         LDAPEntry getEntryRecord();
+        int readNextRecord( bool first=false );
+        //LDAPRequest getChangeRecord();
 
     private:
         int getLdifLine(std::string &line);
 
-        int splitLine(const std::string& line, 
+        void splitLine(const std::string& line, 
                     std::string &type,
-                    std::string &value );
+                    std::string &value ) const;
 
         std::string readIncludeLine( const std::string &line) const;
 
         std::istream &m_ldifstream;
         LdifRecord m_currentRecord;
+        int m_version;
         int m_curRecType;
+        int m_lineNumber;
+        bool m_ldifTypeRequest;
+        bool m_currentIsFirst;
 };
 
 #endif /* LDIF_READER_H */