[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdesupport/strigi/src/streamanalyzer
From:       Roberto Raggi <roberto () kdevelop ! org>
Date:       2007-03-26 21:43:50
Message-ID: 1174945430.067832.17141.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 646921 by raggi:

compile on OSX.


 M  +2 -0      analysisresult.h  
 M  +24 -20    streamanalyzer.cpp  
 M  +2 -2      streamanalyzer.h  


--- trunk/kdesupport/strigi/src/streamanalyzer/analysisresult.h #646920:646921
@@ -40,6 +40,7 @@
 class StreamAnalyzer;
 class RegisteredField;
 class StreamEndAnalyzer;
+class StreamEndAnalyzerPrivate;
 
 /**
  * Indexed representation of a file.
@@ -51,6 +52,7 @@
 class STREAMANALYZER_EXPORT AnalysisResult {
 friend class IndexWriter;
 friend class StreamAnalyzer;
+friend class StreamAnalyzerPrivate;
 private:
     int64_t m_id;
     void* m_writerData;
--- trunk/kdesupport/strigi/src/streamanalyzer/streamanalyzer.cpp #646920:646921
@@ -60,7 +60,9 @@
 using namespace jstreams;
 using namespace Strigi;
 
-class StreamAnalyzer::Private {
+namespace Strigi {
+
+class StreamAnalyzerPrivate {
 public:
     AnalyzerConfiguration& conf;
     vector<StreamThroughAnalyzerFactory*> throughfactories;
@@ -89,11 +91,13 @@
     void removeIndexable(unsigned depth);
     char analyze(AnalysisResult& idx, StreamBase<char>* input);
 
-    Private(AnalyzerConfiguration& c);
-    ~Private();
+    StreamAnalyzerPrivate(AnalyzerConfiguration& c);
+    ~StreamAnalyzerPrivate();
 };
 
-StreamAnalyzer::Private::Private(AnalyzerConfiguration& c) :conf(c), writer(0) {
+} // namespace Strigi
+
+StreamAnalyzerPrivate::StreamAnalyzerPrivate(AnalyzerConfiguration& c) :conf(c), writer(0) {
     moduleLoader = new AnalyzerLoader();
     sizefield = c.getFieldRegister().registerField("size",
         FieldRegister::integerType, 1, 0);
@@ -106,7 +110,7 @@
     initializeThroughFactories();
     initializeEndFactories();
 }
-StreamAnalyzer::Private::~Private() {
+StreamAnalyzerPrivate::~StreamAnalyzerPrivate() {
     // delete all factories
     vector<StreamThroughAnalyzerFactory*>::iterator ta;
     for (ta = throughfactories.begin(); ta != throughfactories.end(); ++ta) {
@@ -150,7 +154,7 @@
 }
 
 StreamAnalyzer::StreamAnalyzer(AnalyzerConfiguration& c)
-        :p(new Private(c)) {
+        :p(new StreamAnalyzerPrivate(c)) {
 }
 StreamAnalyzer::~StreamAnalyzer() {
     delete p;
@@ -189,7 +193,7 @@
     }
 }
 void
-StreamAnalyzer::Private::addFactory(StreamThroughAnalyzerFactory* f) {
+StreamAnalyzerPrivate::addFactory(StreamThroughAnalyzerFactory* f) {
     f->registerFields(conf.getFieldRegister());
     if (conf.useFactory(f)) {
         throughfactories.push_back(f);
@@ -198,7 +202,7 @@
     }
 }
 void
-StreamAnalyzer::Private::initializeSaxFactories() {
+StreamAnalyzerPrivate::initializeSaxFactories() {
     list<StreamSaxAnalyzerFactory*> plugins
         = moduleLoader->getStreamSaxAnalyzerFactories();
     list<StreamSaxAnalyzerFactory*>::iterator i;
@@ -208,7 +212,7 @@
     addFactory(new HtmlSaxAnalyzerFactory());
 }
 void
-StreamAnalyzer::Private::initializeLineFactories() {
+StreamAnalyzerPrivate::initializeLineFactories() {
     list<StreamLineAnalyzerFactory*> plugins
         = moduleLoader->getStreamLineAnalyzerFactories();
     list<StreamLineAnalyzerFactory*>::iterator i;
@@ -218,7 +222,7 @@
     addFactory(new OdfMimeTypeLineAnalyzerFactory());
 }
 void
-StreamAnalyzer::Private::initializeEventFactories() {
+StreamAnalyzerPrivate::initializeEventFactories() {
     list<StreamEventAnalyzerFactory*> plugins
         = moduleLoader->getStreamEventAnalyzerFactories();
     list<StreamEventAnalyzerFactory*>::iterator i;
@@ -227,7 +231,7 @@
     }
 }
 void
-StreamAnalyzer::Private::initializeThroughFactories() {
+StreamAnalyzerPrivate::initializeThroughFactories() {
     list<StreamThroughAnalyzerFactory*> plugins
         = moduleLoader->getStreamThroughAnalyzerFactories();
     list<StreamThroughAnalyzerFactory*>::iterator i;
@@ -241,7 +245,7 @@
         eventfactories));
 }
 void
-StreamAnalyzer::Private::addFactory(StreamEventAnalyzerFactory* f) {
+StreamAnalyzerPrivate::addFactory(StreamEventAnalyzerFactory* f) {
     f->registerFields(conf.getFieldRegister());
     if (conf.useFactory(f)) {
         eventfactories.push_back(f);
@@ -250,7 +254,7 @@
     }
 }
 void
-StreamAnalyzer::Private::addFactory(StreamLineAnalyzerFactory* f) {
+StreamAnalyzerPrivate::addFactory(StreamLineAnalyzerFactory* f) {
     f->registerFields(conf.getFieldRegister());
     if (conf.useFactory(f)) {
         linefactories.push_back(f);
@@ -259,7 +263,7 @@
     }
 }
 void
-StreamAnalyzer::Private::addFactory(StreamSaxAnalyzerFactory* f) {
+StreamAnalyzerPrivate::addFactory(StreamSaxAnalyzerFactory* f) {
     f->registerFields(conf.getFieldRegister());
     if (conf.useFactory(f)) {
         saxfactories.push_back(f);
@@ -268,7 +272,7 @@
     }
 }
 void
-StreamAnalyzer::Private::addFactory(StreamEndAnalyzerFactory* f) {
+StreamAnalyzerPrivate::addFactory(StreamEndAnalyzerFactory* f) {
     f->registerFields(conf.getFieldRegister());
     if (conf.useFactory(f)) {
         endfactories.push_back(f);
@@ -280,7 +284,7 @@
  * Instantiate factories for all analyzers.
  **/
 void
-StreamAnalyzer::Private::initializeEndFactories() {
+StreamAnalyzerPrivate::initializeEndFactories() {
     list<StreamEndAnalyzerFactory*> plugins
         = moduleLoader->getStreamEndAnalyzerFactories();
     list<StreamEndAnalyzerFactory*>::iterator i;
@@ -310,7 +314,7 @@
     addFactory(new TextEndAnalyzerFactory());
 }
 void
-StreamAnalyzer::Private::addThroughAnalyzers() {
+StreamAnalyzerPrivate::addThroughAnalyzers() {
     through.resize(through.size()+1);
     vector<vector<StreamThroughAnalyzer*> >::reverse_iterator tIter;
     tIter = through.rbegin();
@@ -320,7 +324,7 @@
     }
 }
 void
-StreamAnalyzer::Private::addEndAnalyzers() {
+StreamAnalyzerPrivate::addEndAnalyzers() {
     end.resize(end.size()+1);
     vector<vector<StreamEndAnalyzer*> >::reverse_iterator eIter;
     eIter = end.rbegin();
@@ -334,7 +338,7 @@
     return p->analyze(idx, input);
 }
 char
-StreamAnalyzer::Private::analyze(AnalysisResult& idx, StreamBase<char>* input) {
+StreamAnalyzerPrivate::analyze(AnalysisResult& idx, StreamBase<char>* input) {
 //    static int count = 1;
 //    if (++count % 1000 == 0) {
 //        fprintf(stderr, "file #%i: %s\n", count, path.c_str());
@@ -431,7 +435,7 @@
  * Remove references to the analysisresult before it goes out of scope.
  **/
 void
-StreamAnalyzer::Private::removeIndexable(uint depth) {
+StreamAnalyzerPrivate::removeIndexable(uint depth) {
     vector<vector<StreamThroughAnalyzer*> >::iterator tIter;
     vector<StreamThroughAnalyzer*>::iterator ts;
     tIter = through.begin() + depth;
--- trunk/kdesupport/strigi/src/streamanalyzer/streamanalyzer.h #646920:646921
@@ -32,6 +32,7 @@
 class AnalyzerConfiguration;
 class IndexWriter;
 class AnalysisResult;
+class StreamAnalyzerPrivate;
 
 /**
  * The class StreamAnalyzer extracts information from files or character
@@ -47,8 +48,7 @@
  **/
 class STREAMANALYZER_EXPORT StreamAnalyzer {
 private:
-    class Private;
-    Private* const p;
+    StreamAnalyzerPrivate* const p;
 
 public:
     StreamAnalyzer(AnalyzerConfiguration& c);
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic