[sword-svn] r3883 - trunk/tests
scribe at crosswire.org
scribe at crosswire.org
Sat Sep 17 06:02:22 EDT 2022
Author: scribe
Date: 2022-09-17 06:02:21 -0400 (Sat, 17 Sep 2022)
New Revision: 3883
Modified:
trunk/tests/httptest.cpp
Log:
updated test to fix misleading host name parameter
added comments and examples (commented out) for how
to use other transports
Modified: trunk/tests/httptest.cpp
===================================================================
--- trunk/tests/httptest.cpp 2022-08-07 17:53:23 UTC (rev 3882)
+++ trunk/tests/httptest.cpp 2022-09-17 10:02:21 UTC (rev 3883)
@@ -1,4 +1,6 @@
#include <curlhttpt.h>
+//#include <curlftpt.h>
+//#include <ftplibftpt.h>
#include <filemgr.h>
#include <vector>
#include <iostream>
@@ -11,9 +13,21 @@
using std::endl;
int main(int argc, char **argv) {
- RemoteTransport *t = new CURLHTTPTransport("crosswire");
- vector<DirEntry> x = t->getDirList("https://ftp.crosswire.org/ftpmirror/pub/sword/raw/");
-// auto x = t->getDirList("https://crosswire.org/ftpmirror/pub/sword/raw/");
+ RemoteTransport *t = new CURLHTTPTransport("crosswire.org");
+ vector<DirEntry> x = t->getDirList("https://crosswire.org/ftpmirror/pub/sword/raw/");
+// ##
+// ## These other transports should work the same as CURLHTTPTransport
+// ##
+// RemoteTransport *t = new sword::CURLFTPTransport("ftp.crosswire.org");
+// vector<DirEntry> x = t->getDirList("ftp://ftp.crosswire.org/pub/sword/raw/");
+// ##
+// ## FTPLib support is usually not compiled if CURL support is enabled
+// ## To test this transport, re-configure sword (usrinst.sh: without-curl), recompile,
+// ## reinstall, then copy this file over to examples/classes and make there. The
+// ## Makefile there will build any .cpp file against the installed libsword.
+// ##
+// RemoteTransport *t = new sword::FTPLibFTPTransport("ftp.crosswire.org");
+// vector<DirEntry> x = t->getDirList("ftp://ftp.crosswire.org/pub/sword/raw/");
for (vector<DirEntry>::const_iterator i = x.begin(); i != x.end(); ++i) {
cout << i->name << "\t" << i->size << "\t" << i->isDirectory << endl;
}
More information about the sword-cvs
mailing list