00001
00002
00003
00004
00005 #ifndef _QUESTION_SOURCE_H_
00006 #define _QUESTION_SOURCE_H_
00007
00008 #include "CatalogManager.h"
00009 #include "Question.h"
00010
00011 #include <string>
00012 #include <vector>
00013
00014 namespace Limiro
00015 {
00016
00018
00022 class QuestionSource
00023 {
00024 public:
00025 QuestionSource();
00026 ~QuestionSource();
00027
00028 bool addCatalog(const std::string& filename);
00029 bool addCatalog(const CatalogInfo& catalog);
00030 bool addCatalogs(const std::vector<std::string>& filenames);
00031 bool addCatalogs(const CatalogList& catalogs);
00032
00033 Question *getQuestion();
00034 std::vector<Question *> getQuestions(int num);
00035
00037 bool empty() const {return (m_questions.size() == 0);};
00038
00040 const std::vector<std::string>& getFiles() const {return m_files;};
00041
00042 private:
00043 bool loadXmlCatalog(const std::string& filename);
00044
00045 std::vector<QuestionPattern *> m_questions;
00046 std::vector<std::string> m_files;
00047 };
00048
00049 }
00050
00051 #endif // _QUESTION_SOURCE_H_