[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:45:46 UTC 2017


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=8ff86b6

The following commit has been merged in the master branch:
commit 8ff86b68759baeeda2c37caa1570de373e085635
Author: Robin Mills <robin at clanmills.com>
Date:   Wed Sep 23 20:43:16 2015 +0000

    #1110.  Xcode project moved to contrib/xcode.  Interesting errors in samples/Makefile.  Replaced gsoc13 Exiv2::dict_t with (identical twin) Exiv2::Dictionary
---
 {xcode => contrib/xcode}/ReadMe.txt                |  0
 .../xcode}/exiv2.xcodeproj/project.pbxproj         |  0
 include/exiv2/exiv2.hpp                            |  2 +-
 include/exiv2/http.hpp                             |  8 ++--
 samples/Makefile                                   |  4 +-
 samples/conntest.cpp                               | 25 ++++++-----
 samples/exiv2json.cpp                              |  1 -
 samples/httptest.cpp                               | 49 +++++++++++-----------
 src/basicio.cpp                                    | 16 +++----
 src/http.cpp                                       |  9 ++--
 10 files changed, 55 insertions(+), 59 deletions(-)

diff --git a/xcode/ReadMe.txt b/contrib/xcode/ReadMe.txt
similarity index 100%
copy from xcode/ReadMe.txt
copy to contrib/xcode/ReadMe.txt
diff --git a/xcode/exiv2.xcodeproj/project.pbxproj b/contrib/xcode/exiv2.xcodeproj/project.pbxproj
similarity index 100%
copy from xcode/exiv2.xcodeproj/project.pbxproj
copy to contrib/xcode/exiv2.xcodeproj/project.pbxproj
diff --git a/include/exiv2/exiv2.hpp b/include/exiv2/exiv2.hpp
index 878b939..19b31a2 100644
--- a/include/exiv2/exiv2.hpp
+++ b/include/exiv2/exiv2.hpp
@@ -31,12 +31,12 @@
 
 // *****************************************************************************
 // included header files
+#include "datasets.hpp"
 #include "basicio.hpp"
 #include "bmpimage.hpp"
 #include "convert.hpp"
 #include "cr2image.hpp"
 #include "crwimage.hpp"
-#include "datasets.hpp"
 #include "easyaccess.hpp"
 #include "epsimage.hpp"
 #include "error.hpp"
diff --git a/include/exiv2/http.hpp b/include/exiv2/http.hpp
index e4e5ad1..6805f33 100644
--- a/include/exiv2/http.hpp
+++ b/include/exiv2/http.hpp
@@ -5,12 +5,10 @@
 #include <map>
 #include <algorithm>
 
-namespace Exiv2 {
-    typedef std::map<std::string,std::string> dict_t;
-    typedef dict_t::iterator                  dict_i;
-
-    EXIV2API int http(dict_t& request,dict_t& response,std::string& errors);
+#include "datasets.hpp"
 
+namespace Exiv2 {
+    EXIV2API int http(Exiv2::Dictionary& request,Exiv2::Dictionary& response,std::string& errors);
 }
 
 #ifndef EXV_USE_CURL
diff --git a/samples/Makefile b/samples/Makefile
index 0a4aff5..c3ca651 100644
--- a/samples/Makefile
+++ b/samples/Makefile
@@ -123,7 +123,7 @@ LINK.cc += -rpath $(PREFIX) -L$(PREFIX)
 # to build the samples. Some errors only show up in this scenario, e.g., errors
 # due to missing headers which are not installed (depending on compile-time
 # settings) but may be wrongly included from other headers.
-COMPILE.cc += -I$(top_srcdir)/include/exiv2
+COMPILE.cc += -I$(top_srcdir)/include -I$(top_srcdir)/include/exiv2
 
 # ******************************************************************************
 # Rules
@@ -168,7 +168,7 @@ geotag: %: %.cpp
 
 # link applications which require utils.cpp support
 metacopy path-test: %: %.cpp ../src/utils.o
-	$(COMPILE.cc) -I../src -I../include/exiv2 -o $@.o $<
+	$(COMPILE.cc) -I../src -I../include -I../include/exiv2 -o $@.o $<
 	@$(MAKEDEPEND)
 	@$(POSTDEPEND)
 	$(LIBTOOL) --mode=link $(LINK.cc) $@.o ../src/utils.o -o ../bin/$@
diff --git a/samples/conntest.cpp b/samples/conntest.cpp
index 777f1da..43eb42e 100644
--- a/samples/conntest.cpp
+++ b/samples/conntest.cpp
@@ -6,12 +6,11 @@
 
 #include <iostream>
 #include <stdlib.h>
-using namespace std;
 
 void httpcon(const std::string& url, bool useHttp1_0 = false) {
-    Exiv2::dict_t response;
-    Exiv2::dict_t request;
-    string        errors;
+    Exiv2::Dictionary response;
+    Exiv2::Dictionary request;
+    std::string       errors;
 
     Exiv2::Uri uri = Exiv2::Uri::Parse(url);
     Exiv2::Uri::Decode(uri);
@@ -41,7 +40,7 @@ void curlcon(const std::string& url, bool useHttp1_0 = false) {
         throw Exiv2::Error(1, "Timeout Environmental Variable must be a positive integer.");
     }
 
-    string response;
+    std::string response;
     curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
     curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, Exiv2::curlWriter);
     curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);
@@ -74,14 +73,14 @@ void sshcon(const std::string& url) {
     Exiv2::Uri uri = Exiv2::Uri::Parse(url);
     Exiv2::Uri::Decode(uri);
 
-    string page = uri.Path;
+    std::string page = uri.Path;
     // remove / at the beginning of the path
     if (page[0] == '/') {
         page = page.substr(1);
     }
     Exiv2::SSH ssh(uri.Host, uri.Username, uri.Password, uri.Port);
-    string response = "";
-    string cmd = "declare -a x=($(ls -alt " + page + ")); echo ${x[4]}";
+    std::string response = "";
+    std::string cmd = "declare -a x=($(ls -alt " + page + ")); echo ${x[4]}";
     if (ssh.runCommand(cmd, &response) != 0) {
         throw Exiv2::Error(1, "Unable to get file length.");
     } else {
@@ -96,7 +95,7 @@ void sftpcon(const std::string& url) {
     Exiv2::Uri uri = Exiv2::Uri::Parse(url);
     Exiv2::Uri::Decode(uri);
 
-    string page = uri.Path;
+    std::string page = uri.Path;
     // remove / at the beginning of the path
     if (page[0] == '/') {
         page = page.substr(1);
@@ -112,7 +111,7 @@ void sftpcon(const std::string& url) {
 int main(int argc,const char** argv)
 {
     if (argc < 2) {
-        cout << "Usage: " << argv[0] << " url {-http1_0}
";
+        std::cout << "Usage: " << argv[0] << " url {-http1_0}" << std::endl;
         return 1;
     }
     std::string url(argv[1]);
@@ -146,12 +145,12 @@ int main(int argc,const char** argv)
             isOk = true;
         }
     } catch (Exiv2::AnyError& e) {
-        std::cout << "Error: '" << e << "'
";
+        std::cout << "Error: '" << e << "'" << std::endl;
         return -1;
     }
 
-    if (!isOk)  cout << "The protocol is unsupported.
";
-    else        cout << "OK.
";
+    if (!isOk)  std::cout << "The protocol is unsupported." << std::endl;
+    else        std::cout << "OK." << std::endl;
     return 0;
 }
 
diff --git a/samples/exiv2json.cpp b/samples/exiv2json.cpp
index 4527145..505268d 100644
--- a/samples/exiv2json.cpp
+++ b/samples/exiv2json.cpp
@@ -3,7 +3,6 @@
 // Sample program to print metadata in JSON format
 
 #include <exiv2/exiv2.hpp>
-#include <exiv2/datasets.hpp>
 #include "Jzon.h"
 
 #include <iostream>
diff --git a/samples/httptest.cpp b/samples/httptest.cpp
index defbc28..d8d267a 100644
--- a/samples/httptest.cpp
+++ b/samples/httptest.cpp
@@ -8,12 +8,11 @@
 
 #include <iostream>
 #include <stdlib.h>
-using namespace std;
 
 static int testSyntax(const char* arg)
 {
 	if ( !arg ) {
-		cout << "insufficient input" << endl;
+		std::cout << "insufficient input" << std::endl;
 		exit(0);
 	}
 	return 0;
@@ -22,18 +21,18 @@ static int testSyntax(const char* arg)
 int main(int argc,const char** argv)
 {
     if ( argc < 2 ) {
-        cout << "usage  : " << argv[0] << " [key value]+" << endl;
-        cout << "example: " << argv[0] << " [[-url] url | -server clanmills.com -page /LargsPanorama.jpg] -header \"Range: bytes=0-200\"" << endl;
-		cout << "or     : " << argv[0] << " http://clanmills.com/LargsPanorama.jpg"                                     << endl;
-        cout << "useful  keys: -verb {GET|HEAD|PUT}  -page str -server str -port number -version [-header something]+ " << endl;
-        cout << "default keys: -verb GET -server clanmills.com -page robin.shtml -port 80 -version 1.0"                 << endl;
-        cout << "export http_proxy=url eg export http_proxy=http://64.62.247.244:80"                                    << endl;
+        std::cout << "usage  : " << argv[0] << " [key value]+" << std::endl;
+        std::cout << "example: " << argv[0] << " [[-url] url | -server clanmills.com -page /LargsPanorama.jpg] -header \"Range: bytes=0-200\"" << std::endl;
+		std::cout << "or     : " << argv[0] << " http://clanmills.com/LargsPanorama.jpg"                                     << std::endl;
+        std::cout << "useful  keys: -verb {GET|HEAD|PUT}  -page str -server str -port number -version [-header something]+ " << std::endl;
+        std::cout << "default keys: -verb GET -server clanmills.com -page robin.shtml -port 80 -version 1.0"                 << std::endl;
+        std::cout << "export http_proxy=url eg export http_proxy=http://64.62.247.244:80"                                    << std::endl;
         return 0;
     }
 
-    Exiv2::dict_t response;
-    Exiv2::dict_t request;
-    string        errors;
+    Exiv2::Dictionary response;
+    Exiv2::Dictionary request;
+    std::string       errors;
 
     // convert the command-line arguments into the request dictionary
     for ( int i = 1 ; i < argc ; i +=2 ) {
@@ -41,14 +40,14 @@ int main(int argc,const char** argv)
         // skip past the -'s on the key
         while ( arg[0] == '-' ) arg++;
 
-        if ( string(arg) == "header" ) {
+        if ( std::string(arg) == "header" ) {
 			testSyntax(argv[i+1]);
-            string header = argv[i+1];
+            std::string header = argv[i+1];
             if ( ! strchr(argv[i+1],'
') ) {
                 header += "
";
             }
             request[arg] += header;
-        } else if ( string(arg) == "uri" || string(arg) == "url" ) {
+        } else if ( std::string(arg) == "uri" || std::string(arg) == "url" ) {
 			testSyntax(argv[i+1]);
         	Exiv2::Uri uri = Exiv2::Uri::Parse(argv[i+1]);
         	if ( uri.Protocol == "http" ) {
@@ -56,7 +55,7 @@ int main(int argc,const char** argv)
         	    request["page"]   = uri.Path;
         	    request["port"]   = uri.Port;
         	}
-		} else if ( string(arg).substr(0,7) == "http://" ) {
+		} else if ( std::string(arg).substr(0,7) == "http://" ) {
         	Exiv2::Uri uri = Exiv2::Uri::Parse(argv[i--]);
         	if ( uri.Protocol == "http" ) {
         	    request["server"] = uri.Host;
@@ -72,25 +71,25 @@ int main(int argc,const char** argv)
     if ( !request.count("server") ) request["server"]   = "clanmills.com";
 
     int result = Exiv2::http(request,response,errors);
-    cout << "result = " << result << endl;
-    cout << "errors = " << errors << endl;
-    cout << endl;
+    std::cout << "result = " << result << std::endl;
+    std::cout << "errors = " << errors << std::endl;
+    std::cout << std::endl;
 
-    for ( Exiv2::dict_i it = response.begin() ; it != response.end() ; it++ ) {
+    for ( Exiv2::Dictionary_i it = response.begin() ; it != response.end() ; it++ ) {
         // don't show request header
         if (it->first ==  "requestheaders") continue;
 
-        cout << it->first << " -> ";
+        std::cout << it->first << " -> ";
 
         if ( it->first ==  "body") {
-        	string& value = it->second;
-        	cout << "# " << value.length();
-        	if ( value.length() < 1000 ) cout << " = " << value ;
+        	std::string value(it->second);
+        	std::cout << "# " << value.length();
+        	if ( value.length() < 1000 ) std::cout << " = " << value ;
         } else {
-        	cout << it->second;
+        	std::cout << it->second;
         }
 
-        cout << endl;
+        std::cout << std::endl;
     }
 
     return 0;
diff --git a/src/basicio.cpp b/src/basicio.cpp
index 3dd7d16..1965326 100644
--- a/src/basicio.cpp
+++ b/src/basicio.cpp
@@ -30,7 +30,7 @@ EXIV2_RCSID("@(#) $Id$")
 
 // included header files
 #include "config.h"
-
+#include "datasets.hpp"
 #include "basicio.hpp"
 #include "futils.hpp"
 #include "types.hpp"
@@ -2012,8 +2012,8 @@ namespace Exiv2 {
 
     long HttpIo::HttpImpl::getFileLength()
     {
-        dict_t response;
-        dict_t request;
+        Exiv2::Dictionary response;
+        Exiv2::Dictionary request;
         std::string errors;
         request["server"] = hostInfo_.Host;
         request["page"  ] = hostInfo_.Path;
@@ -2024,14 +2024,14 @@ namespace Exiv2 {
             throw Error(55, "Server", serverCode);
         }
 
-        dict_i lengthIter = response.find("Content-Length");
+        Exiv2::Dictionary_i lengthIter = response.find("Content-Length");
         return (lengthIter == response.end()) ? -1 : atol((lengthIter->second).c_str());
     }
 
     void HttpIo::HttpImpl::getDataByRange(long lowBlock, long highBlock, std::string& response)
     {
-        dict_t responseDic;
-        dict_t request;
+        Exiv2::Dictionary responseDic;
+        Exiv2::Dictionary request;
         request["server"] = hostInfo_.Host;
         request["page"  ] = hostInfo_.Path;
         if (hostInfo_.Port != "") request["port"] = hostInfo_.Port;
@@ -2063,8 +2063,8 @@ namespace Exiv2 {
             scriptPath = "/" + scriptPath;
         }
 
-        dict_t response;
-        dict_t request;
+        Exiv2::Dictionary response;
+        Exiv2::Dictionary request;
         std::string errors;
 
         Uri scriptUri = Exiv2::Uri::Parse(scriptPath);
diff --git a/src/http.cpp b/src/http.cpp
index b8a429b..a8c8b35 100644
--- a/src/http.cpp
+++ b/src/http.cpp
@@ -26,6 +26,7 @@
 // included header files
 #include "config.h"
 
+#include "datasets.hpp"
 #include "http.hpp"
 #include "futils.hpp"
 
@@ -171,9 +172,9 @@ static void flushBuffer(const char* buffer,size_t start,int& end,std::string& fi
     end = 0 ;
 }
 
-static Exiv2::dict_t stringToDict(const std::string& s)
+static Exiv2::Dictionary stringToDict(const std::string& s)
 {
-    Exiv2::dict_t result;
+    Exiv2::Dictionary result;
     std::string   token;
 
     size_t i = 0;
@@ -203,7 +204,7 @@ static int makeNonBlocking(int sockfd)
 #endif
 }
 
-int Exiv2::http(dict_t& request,dict_t& response,std::string& errors)
+int Exiv2::http(Exiv2::Dictionary& request,Exiv2::Dictionary& response,std::string& errors)
 {
     if ( !request.count("verb")   ) request["verb"   ] = "GET";
     if ( !request.count("header") ) request["header" ] = ""   ;
@@ -248,7 +249,7 @@ int Exiv2::http(dict_t& request,dict_t& response,std::string& errors)
     const char* no_proxy = getenv(no_proxi);
     bool        bNoProxy = NO_PROXY||no_proxy;
     std::string no_prox  = std::string(bNoProxy?(no_proxy?no_proxy:NO_PROXY):"");
-    Exiv2::dict_t noProxy= stringToDict(no_prox + ",localhost,127.0.0.1");
+    Exiv2::Dictionary noProxy= stringToDict(no_prox + ",localhost,127.0.0.1");
 
     // if the server is on the no_proxy list ... ignore the proxy!
     if ( noProxy.count(servername) ) bProx = false;

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list