summaryrefslogtreecommitdiff
path: root/src/libutil
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2014-07-23 16:44:07 +0200
committerAndreas Baumann <abaumann@yahoo.com>2014-07-23 16:44:07 +0200
commita57788acee59705418b96525410b84fbee2f405a (patch)
tree660a828a29f0f769638ce18c1b45c62bd602e012 /src/libutil
parentce77513807f47bc7af59c8320932d3348aeb99ea (diff)
downloadcrawler-a57788acee59705418b96525410b84fbee2f405a.tar.gz
crawler-a57788acee59705418b96525410b84fbee2f405a.tar.bz2
added parsing of Sitemap in robots.txt
Diffstat (limited to 'src/libutil')
-rwxr-xr-xsrc/libutil/GNUmakefile3
-rwxr-xr-xsrc/libutil/Makefile.W322
-rw-r--r--src/libutil/StringUtils.cpp23
3 files changed, 27 insertions, 1 deletions
diff --git a/src/libutil/GNUmakefile b/src/libutil/GNUmakefile
index 9bb47f5..87cf711 100755
--- a/src/libutil/GNUmakefile
+++ b/src/libutil/GNUmakefile
@@ -9,7 +9,7 @@ INCLUDE_CPPFLAGS = \
INCLUDE_LDFLAGS = \
INCLUDE_DIRS = \
- -I$(TOPDIR)/include/util
+ -I$(TOPDIR)/include
INCLUDE_LIBS = \
@@ -21,6 +21,7 @@ DYNAMIC_LIB_MINOR = 0
DYNAMIC_LIB_PATCH = 0
CPP_OBJS = \
+ StringUtils.o
-include $(TOPDIR)/makefiles/gmake/sub.mk
diff --git a/src/libutil/Makefile.W32 b/src/libutil/Makefile.W32
index 2a5630f..c4c8f83 100755
--- a/src/libutil/Makefile.W32
+++ b/src/libutil/Makefile.W32
@@ -17,10 +17,12 @@ INCLUDE_LDFLAGS = \
INCLUDE_LIBS = \
CPP_OBJS = \
+ StringUtils.obj \
win32\errormsg.obj \
win32\stringutils.obj
DYNAMIC_CPP_OBJS = \
+ StringUtils.dllobj \
win32\errormsg.dllobj \
win32\stringutils.dllobj
diff --git a/src/libutil/StringUtils.cpp b/src/libutil/StringUtils.cpp
new file mode 100644
index 0000000..61769c9
--- /dev/null
+++ b/src/libutil/StringUtils.cpp
@@ -0,0 +1,23 @@
+#include "util/StringUtils.hpp"
+
+#include <algorithm>
+#include <cctype>
+
+using namespace std;
+
+bool stringicasecmp( const string &s1, const string &s2 )
+{
+ string::const_iterator i1 = s1.begin( ), e1 = s1.end( ),
+ i2 = s2.begin( ), e2 = s2.end( );
+
+ while( i1 != e1 && i2 != e2 ) {
+ if( toupper( *i1 ) != toupper( *i2 ) ) return false;
+ i1++;
+ i2++;
+ }
+
+ if( i1 == e1 && i2 == e2 ) return true;
+
+ return false;
+}
+