summaryrefslogtreecommitdiff
path: root/cmake/platforms/windows
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/platforms/windows')
-rw-r--r--cmake/platforms/windows/qt.conf2
-rw-r--r--cmake/platforms/windows/rawfiles.cpp228
-rw-r--r--cmake/platforms/windows/rawfiles.h94
3 files changed, 163 insertions, 161 deletions
diff --git a/cmake/platforms/windows/qt.conf b/cmake/platforms/windows/qt.conf
new file mode 100644
index 0000000..dfc4208
--- /dev/null
+++ b/cmake/platforms/windows/qt.conf
@@ -0,0 +1,2 @@
+[Paths]
+Plugins=plugins
diff --git a/cmake/platforms/windows/rawfiles.cpp b/cmake/platforms/windows/rawfiles.cpp
index 3901c22..25bbcac 100644
--- a/cmake/platforms/windows/rawfiles.cpp
+++ b/cmake/platforms/windows/rawfiles.cpp
@@ -1,13 +1,13 @@
/******************************************************************************
* rawfiles.cpp - code for class 'RawFiles'- a module that produces HTML HREFs
- * pointing to actual text desired. Uses standard
- * files: ot and nt using indexs ??.bks ??.cps ??.vss
+ * pointing to actual text desired. Uses standard
+ * files: ot and nt using indexs ??.bks ??.cps ??.vss
*
*
* Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)
- * CrossWire Bible Society
- * P. O. Box 2528
- * Tempe, AZ 85280-2528
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -35,9 +35,9 @@ SWORD_NAMESPACE_START
/******************************************************************************
* RawFiles Constructor - Initializes data for instance of RawFiles
*
- * ENT: iname - Internal name for module
- * idesc - Name to display to user for module
- * idisp - Display object to use for displaying
+ * ENT: iname - Internal name for module
+ * idesc - Name to display to user for module
+ * idisp - Display object to use for displaying
*/
RawFiles::RawFiles(const char *ipath, const char *iname, const char *idesc, SWDisplay *idisp, SWTextEncoding enc, SWTextDirection dir, SWTextMarkup mark, const char* ilang) : RawVerse(ipath, FileMgr::RDWR), SWCom(iname, idesc, idisp, enc, dir, mark, ilang)
@@ -58,169 +58,169 @@ RawFiles::~RawFiles()
* @return yes or no
*/
bool RawFiles::isWritable() {
- return ((idxfp[0]->getFd() > 0) && ((idxfp[0]->mode & FileMgr::RDWR) == FileMgr::RDWR));
+ return ((idxfp[0]->getFd() > 0) && ((idxfp[0]->mode & FileMgr::RDWR) == FileMgr::RDWR));
}
/******************************************************************************
- * RawFiles::getRawEntry - Retrieve the unprocessed entry contents at
- * the current key position of this module
+ * RawFiles::getRawEntry - Retrieve the unprocessed entry contents at
+ * the current key position of this module
*
* RET: entry contents
*/
SWBuf &RawFiles::getRawEntryBuf() {
- FileDesc *datafile;
- long start = 0;
- unsigned short size = 0;
- VerseKey *key = &getVerseKey();
-
- findOffset(key->Testament(), key->TestamentIndex(), &start, &size);
-
- entryBuf = "";
- if (size) {
- SWBuf tmpbuf = path;
- tmpbuf += '/';
- readText(key->Testament(), start, size, entryBuf);
- tmpbuf += entryBuf;
- entryBuf = "";
- datafile = FileMgr::getSystemFileMgr()->open(tmpbuf.c_str(), FileMgr::RDONLY);
- if (datafile->getFd() > 0) {
- size = datafile->seek(0, SEEK_END);
- char *tmpBuf = new char [ size + 1 ];
- memset(tmpBuf, 0, size + 1);
- datafile->seek(0, SEEK_SET);
- datafile->read(tmpBuf, size);
- entryBuf = tmpBuf;
- delete [] tmpBuf;
-// preptext(entrybuf);
- }
- FileMgr::getSystemFileMgr()->close(datafile);
- }
- return entryBuf;
+ FileDesc *datafile;
+ long start = 0;
+ unsigned short size = 0;
+ VerseKey *key = &getVerseKey();
+
+ findOffset(key->Testament(), key->TestamentIndex(), &start, &size);
+
+ entryBuf = "";
+ if (size) {
+ SWBuf tmpbuf = path;
+ tmpbuf += '/';
+ readText(key->Testament(), start, size, entryBuf);
+ tmpbuf += entryBuf;
+ entryBuf = "";
+ datafile = FileMgr::getSystemFileMgr()->open(tmpbuf.c_str(), FileMgr::RDONLY);
+ if (datafile->getFd() > 0) {
+ size = datafile->seek(0, SEEK_END);
+ char *tmpBuf = new char [ size + 1 ];
+ memset(tmpBuf, 0, size + 1);
+ datafile->seek(0, SEEK_SET);
+ datafile->read(tmpBuf, size);
+ entryBuf = tmpBuf;
+ delete [] tmpBuf;
+// preptext(entrybuf);
+ }
+ FileMgr::getSystemFileMgr()->close(datafile);
+ }
+ return entryBuf;
}
/******************************************************************************
* RawFiles::setEntry(char *)- Update the module's current key entry with
- * provided text
+ * provided text
*/
void RawFiles::setEntry(const char *inbuf, long len) {
- FileDesc *datafile;
- long start;
- unsigned short size;
- VerseKey *key = &getVerseKey();
-
- len = (len<0)?strlen(inbuf):len;
-
- findOffset(key->Testament(), key->TestamentIndex(), &start, &size);
-
- if (size) {
- SWBuf tmpbuf;
- entryBuf = path;
- entryBuf += '/';
- readText(key->Testament(), start, size, tmpbuf);
- entryBuf += tmpbuf;
- }
- else {
- SWBuf tmpbuf;
- entryBuf = path;
- entryBuf += '/';
- tmpbuf = getNextFilename();
- doSetText(key->Testament(), key->TestamentIndex(), tmpbuf);
- entryBuf += tmpbuf;
- }
- datafile = FileMgr::getSystemFileMgr()->open(entryBuf, FileMgr::CREAT|FileMgr::WRONLY|FileMgr::TRUNC);
- if (datafile->getFd() > 0) {
- datafile->write(inbuf, len);
- }
- FileMgr::getSystemFileMgr()->close(datafile);
+ FileDesc *datafile;
+ long start;
+ unsigned short size;
+ VerseKey *key = &getVerseKey();
+
+ len = (len<0)?strlen(inbuf):len;
+
+ findOffset(key->Testament(), key->TestamentIndex(), &start, &size);
+
+ if (size) {
+ SWBuf tmpbuf;
+ entryBuf = path;
+ entryBuf += '/';
+ readText(key->Testament(), start, size, tmpbuf);
+ entryBuf += tmpbuf;
+ }
+ else {
+ SWBuf tmpbuf;
+ entryBuf = path;
+ entryBuf += '/';
+ tmpbuf = getNextFilename();
+ doSetText(key->Testament(), key->TestamentIndex(), tmpbuf);
+ entryBuf += tmpbuf;
+ }
+ datafile = FileMgr::getSystemFileMgr()->open(entryBuf, FileMgr::CREAT|FileMgr::WRONLY|FileMgr::TRUNC);
+ if (datafile->getFd() > 0) {
+ datafile->write(inbuf, len);
+ }
+ FileMgr::getSystemFileMgr()->close(datafile);
}
/******************************************************************************
* RawFiles::linkEntry(SWKey *)- Link the modules current key entry with
- * another module entry
+ * another module entry
*
* RET: *this
*/
void RawFiles::linkEntry(const SWKey *inkey) {
- long start;
- unsigned short size;
- const VerseKey *key = &getVerseKey();
+ long start;
+ unsigned short size;
+ const VerseKey *key = &getVerseKey();
- findOffset(key->Testament(), key->TestamentIndex(), &start, &size);
+ findOffset(key->Testament(), key->TestamentIndex(), &start, &size);
- if (size) {
- SWBuf tmpbuf;
- readText(key->Testament(), start, size + 2, tmpbuf);
+ if (size) {
+ SWBuf tmpbuf;
+ readText(key->Testament(), start, size + 2, tmpbuf);
- key = &getVerseKey(inkey);
- doSetText(key->Testament(), key->TestamentIndex(), tmpbuf.c_str());
- }
+ key = &getVerseKey(inkey);
+ doSetText(key->Testament(), key->TestamentIndex(), tmpbuf.c_str());
+ }
}
/******************************************************************************
- * RawFiles::deleteEntry - deletes this entry
+ * RawFiles::deleteEntry - deletes this entry
*
* RET: *this
*/
void RawFiles::deleteEntry() {
- VerseKey *key = &getVerseKey();
- doSetText(key->Testament(), key->TestamentIndex(), "");
+ VerseKey *key = &getVerseKey();
+ doSetText(key->Testament(), key->TestamentIndex(), "");
}
/******************************************************************************
* RawFiles::getNextfilename - generates a valid filename in which to store
- * an entry
+ * an entry
*
* RET: filename
*/
const char *RawFiles::getNextFilename() {
- static SWBuf incfile;
- __u32 number = 0;
- FileDesc *datafile;
-
- incfile.setFormatted("%s/incfile", path);
- datafile = FileMgr::getSystemFileMgr()->open(incfile, FileMgr::RDONLY);
- if (datafile->getFd() != -1) {
- if (datafile->read(&number, 4) != 4) number = 0;
- number = swordtoarch32(number);
- }
- number++;
- FileMgr::getSystemFileMgr()->close(datafile);
-
- datafile = FileMgr::getSystemFileMgr()->open(incfile, FileMgr::CREAT|FileMgr::WRONLY|FileMgr::TRUNC);
- incfile.setFormatted("%.7d", number-1);
-
- number = archtosword32(number);
- datafile->write(&number, 4);
-
- FileMgr::getSystemFileMgr()->close(datafile);
- return incfile;
+ static SWBuf incfile;
+ __u32 number = 0;
+ FileDesc *datafile;
+
+ incfile.setFormatted("%s/incfile", path);
+ datafile = FileMgr::getSystemFileMgr()->open(incfile, FileMgr::RDONLY);
+ if (datafile->getFd() != -1) {
+ if (datafile->read(&number, 4) != 4) number = 0;
+ number = swordtoarch32(number);
+ }
+ number++;
+ FileMgr::getSystemFileMgr()->close(datafile);
+
+ datafile = FileMgr::getSystemFileMgr()->open(incfile, FileMgr::CREAT|FileMgr::WRONLY|FileMgr::TRUNC);
+ incfile.setFormatted("%.7d", number-1);
+
+ number = archtosword32(number);
+ datafile->write(&number, 4);
+
+ FileMgr::getSystemFileMgr()->close(datafile);
+ return incfile;
}
char RawFiles::createModule(const char *path) {
- char *incfile = new char [ strlen (path) + 16 ];
+ char *incfile = new char [ strlen (path) + 16 ];
- __u32 zero = 0;
- zero = archtosword32(zero);
+ __u32 zero = 0;
+ zero = archtosword32(zero);
- FileDesc *datafile;
+ FileDesc *datafile;
- sprintf(incfile, "%s/incfile", path);
- datafile = FileMgr::getSystemFileMgr()->open(incfile, FileMgr::CREAT|FileMgr::WRONLY|FileMgr::TRUNC);
- delete [] incfile;
- datafile->write(&zero, 4);
- FileMgr::getSystemFileMgr()->close(datafile);
+ sprintf(incfile, "%s/incfile", path);
+ datafile = FileMgr::getSystemFileMgr()->open(incfile, FileMgr::CREAT|FileMgr::WRONLY|FileMgr::TRUNC);
+ delete [] incfile;
+ datafile->write(&zero, 4);
+ FileMgr::getSystemFileMgr()->close(datafile);
return RawVerse::createModule (path);
}
diff --git a/cmake/platforms/windows/rawfiles.h b/cmake/platforms/windows/rawfiles.h
index 014f40d..4903788 100644
--- a/cmake/platforms/windows/rawfiles.h
+++ b/cmake/platforms/windows/rawfiles.h
@@ -1,14 +1,14 @@
/******************************************************************************
* rawfiles.h - code for class 'RawFiles'- a module that produces HTML HREFs
- * pointing to actual text desired. Uses standard
- * files: ot and nt using indexs ??.bks ??.cps ??.vss
+ * pointing to actual text desired. Uses standard
+ * files: ot and nt using indexs ??.bks ??.cps ??.vss
*
* $Id: rawfiles.h 2599 2011-02-12 05:11:09Z scribe $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
- * CrossWire Bible Society
- * P. O. Box 2528
- * Tempe, AZ 85280-2528
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -33,52 +33,52 @@ SWORD_NAMESPACE_START
class SWDLLEXPORT RawFiles : public RawVerse, public SWCom {
- const char *getNextFilename();
+ const char *getNextFilename();
public:
- RawFiles(const char *ipath, const char *iname = 0, const char *idesc = 0,
- SWDisplay *idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN,
- SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN,
- const char *ilang = 0);
- virtual ~RawFiles();
- virtual SWBuf &getRawEntryBuf();
-
- // write interface ----------------------------
- /** Is the module writable? :)
- * @return yes or no
- */
- virtual bool isWritable();
-
- /** Creates a new module
- * @param path The first parameter is path of the new module
- * @return error
- */
- static char createModule(const char *);
-
- /** Modify the current module entry text
- * - only if module @ref isWritable
- * @return *this
- */
- virtual void setEntry(const char *inbuf, long len = -1); // Modify current module entry
-
- /** Link the current module entry to another module entry
- * - only if module @ref isWritable
- * @return *this
- */
- virtual void linkEntry(const SWKey *linkKey); // Link current module entry to other module entry
-
- /** Delete current module entry - only if module @ref isWritable
- *
- */
- virtual void deleteEntry();
- // end write interface ------------------------
-
-
- // OPERATORS -----------------------------------------------------------------
-
- SWMODULE_OPERATORS
+ RawFiles(const char *ipath, const char *iname = 0, const char *idesc = 0,
+ SWDisplay *idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN,
+ SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN,
+ const char *ilang = 0);
+ virtual ~RawFiles();
+ virtual SWBuf &getRawEntryBuf();
+
+ // write interface ----------------------------
+ /** Is the module writable? :)
+ * @return yes or no
+ */
+ virtual bool isWritable();
+
+ /** Creates a new module
+ * @param path The first parameter is path of the new module
+ * @return error
+ */
+ static char createModule(const char *);
+
+ /** Modify the current module entry text
+ * - only if module @ref isWritable
+ * @return *this
+ */
+ virtual void setEntry(const char *inbuf, long len = -1); // Modify current module entry
+
+ /** Link the current module entry to another module entry
+ * - only if module @ref isWritable
+ * @return *this
+ */
+ virtual void linkEntry(const SWKey *linkKey); // Link current module entry to other module entry
+
+ /** Delete current module entry - only if module @ref isWritable
+ *
+ */
+ virtual void deleteEntry();
+ // end write interface ------------------------
+
+
+ // OPERATORS -----------------------------------------------------------------
+
+ SWMODULE_OPERATORS
};