// SwordIndex.h: interface for the SwordIndex class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_SWORDINDEX_H__C86FE833_2BA2_4D9F_9CAD_2499BD8CA686__INCLUDED_) #define AFX_SWORDINDEX_H__C86FE833_2BA2_4D9F_9CAD_2499BD8CA686__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "resource.h" #include "utils.h" #include #include #include #include //#include #include #include #include struct ltstr { bool operator()(const char* s1, const char* s2) const { return strcmp(s1, s2) < 0; } }; typedef sword::SWModule* Module; typedef std::map ModuleMap; class SwordIndex { private: static void initManager(); static void leaveManager(); static sword::SWMgr* manager; static int indices; static ModuleMap* texts; sword::sbook getBook(int book); sword::SWModule* bible; sword::VerseKey* verse; sword::VerseKey* mark; int book; TCHAR** bookNames; public: SwordIndex(); virtual ~SwordIndex(); UString toString(); String verseText(); ModuleMap::iterator firstModule() {return texts->begin();}; ModuleMap::iterator lastModule() {return texts->end();}; void setModule(Module m); void setMark(); void jumpBack(); void next(); bool initialized() { return (bible!=0);}; UString bookName(int book); TCHAR** getBookNames() {return bookNames;}; static int otBookCount() {return 39;}; static int bookCount() {return 66;}; void setBook(int book); int getBook() const {return book;}; int chapCount(); int maxChapCount() {return 150;}; void setChap(int chap); int getChap(); int verseCount(); int maxVerseCount() {return 176;}; void setVerse(int verse); int getVerse(); void operator++(int) {verse->increment(1);}; void operator--(int) {verse->decrement(1);}; void operator+=(int count) {verse->increment(count);}; void operator-=(int count) {verse->decrement(count);}; }; #endif // !defined(AFX_SWORDINDEX_H__C86FE833_2BA2_4D9F_9CAD_2499BD8CA686__INCLUDED_)