[sword-svn] r3615 - trunk/tests
scribe at crosswire.org
scribe at crosswire.org
Mon Mar 11 11:09:51 MST 2019
Author: scribe
Date: 2019-03-11 11:09:51 -0700 (Mon, 11 Mar 2019)
New Revision: 3615
Added:
trunk/tests/httptest.cpp
Log:
added optional httptest to see if we can parse directory listings from http source
Added: trunk/tests/httptest.cpp
===================================================================
--- trunk/tests/httptest.cpp (rev 0)
+++ trunk/tests/httptest.cpp 2019-03-11 18:09:51 UTC (rev 3615)
@@ -0,0 +1,21 @@
+#include <sword/curlhttpt.h>
+#include <sword/filemgr.h>
+#include <vector>
+#include <iostream>
+
+using sword::RemoteTransport;
+using sword::CURLHTTPTransport;
+using sword::DirEntry;
+using std::vector;
+using std::cout;
+using std::endl;
+
+int main(int argc, char **argv) {
+ RemoteTransport *t = new CURLHTTPTransport("crosswire");
+ auto x = t->getDirList("https://ftp.crosswire.org/ftpmirror/pub/sword/raw/");
+// auto x = t->getDirList("https://crosswire.org/ftpmirror/pub/sword/raw/");
+ for (auto i = x.begin(); i != x.end(); ++i) {
+ cout << i->name << "\t" << i->size << "\t" << i->isDirectory << endl;
+ }
+ return 0;
+}
More information about the sword-cvs
mailing list