trunk: exiv2 v0.25

This commit is contained in:
Robin Mills
2014-12-25 13:55:57 +00:00
parent febb76b2fb
commit d393b0fa7e
194 changed files with 9296 additions and 907 deletions
+36 -9
View File
@@ -8,19 +8,22 @@
##
# Running cmake in a tree in which we have run ./configure ; make
# creates src/exv_conf.h which conflicts with cmake's own exv_conf.h
# creates include/exiv2/exv_conf.h which conflicts with cmake's own exv_conf.h
# This causes incorrect compilation and linking errors.
#
# It's OK to delete this as it will be recreated on demand by <exiv2-dir>/Makefile
if( EXISTS "${CMAKE_SOURCE_DIR}/src/exv_conf.h" )
file(REMOVE "${CMAKE_SOURCE_DIR}/src/exv_conf.h")
if( EXISTS "${CMAKE_SOURCE_DIR}/include/exiv2/exv_conf.h" )
file(REMOVE "${CMAKE_SOURCE_DIR}/include/exiv2/exv_conf.h")
endif()
##
SET(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
CMAKE_MINIMUM_REQUIRED( VERSION 2.6 )
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
PROJECT( exiv2 )
cmake_policy(SET CMP0042 NEW) # enable MACOSX_RPATH support
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
SET( PACKAGE_COPYRIGHT "Andreas Huggel" )
SET( PACKAGE_BUGREPORT "ahuggel@gmx.net" )
SET( PACKAGE "exiv2" )
@@ -43,6 +46,8 @@ OPTION( EXIV2_ENABLE_LENSDATA "Build including lens data"
OPTION( EXIV2_ENABLE_COMMERCIAL "Build with the EXV_COMMERCIAL_VERSION symbol set" OFF )
OPTION( EXIV2_ENABLE_BUILD_SAMPLES "Build the unit tests" ON )
OPTION( EXIV2_ENABLE_BUILD_PO "Build translations files" OFF )
OPTION( EXIV2_ENABLE_CURL "USE Libcurl for HttpIo" ON )
OPTION( EXIV2_ENABLE_SSH "USE Libssh for SshIo" ON )
IF( MINGW OR UNIX )
IF ( CMAKE_CXX_COMPILER STREQUAL "g++" OR CMAKE_C_COMPILER STREQUAL "gcc" )
@@ -57,8 +62,12 @@ IF( MINGW OR UNIX )
ENDIF()
ENDIF( MINGW OR UNIX )
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/src/ ${CMAKE_SOURCE_DIR}/include/ ${CMAKE_SOURCE_DIR}/include/exiv2/)
if( MSVC )
# cmake_policy(SET CMP0008)
include(CMake_msvc.txt)
msvc_runtime_report()
msvc_runtime_configure(${EXIV2_ENABLE_SHARED})
@@ -68,6 +77,8 @@ if( MSVC )
set(E expat-2.1.0)
set(Z zlib-1.2.7)
set(C curl-7.39.0)
set(C libssh-0.5.5)
if( NOT IS_DIRECTORY ./../${E} )
set(OUT_OF_SOURCE 1)
@@ -80,7 +91,21 @@ if( MSVC )
include_directories( ${EXPAT_INCLUDE_DIR} msvc64\\include src\\include)
endif()
FIND_PACKAGE(ZLIB QUIET)
# FIND_PACKAGE(CURL)
if ( NOT CURL_FOUND )
set(CURL_LIBRARY ${CMAKE_SOURCE_DIR}/../${C}/$(ConfigurationName)/curl)
set(CURL_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/../${C})
include_directories( ${CURL_INCLUDE_DIR})
endif()
# FIND_PACKAGE(SSH)
if ( NOT SSH_FOUND )
set(SSH_LIBRARY ${CMAKE_SOURCE_DIR}/../${C}/$(ConfigurationName)/ssh)
set(SSH_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/../${C})
include_directories( ${SSH_INCLUDE_DIR})
endif()
# FIND_PACKAGE(ZLIB QUIET)
if ( NOT ZLIB_FOUND )
set(ZLIB_LIBRARY ${CMAKE_SOURCE_DIR}/../${Z}/$(ConfigurationName)/zlib)
set(ZLIB_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/../${Z})
@@ -191,10 +216,12 @@ ENDIF( EXIV2_ENABLE_BUILD_PO )
##
# tests
ADD_CUSTOM_TARGET(tests COMMAND make test "EXIV2_BINDIR=${CMAKE_BINARY_DIR}/bin" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/test/" )
ADD_CUSTOM_TARGET(teste COMMAND make teste "EXIV2_BINDIR=${CMAKE_BINARY_DIR}/bin" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/test/" )
ADD_CUSTOM_TARGET(testv COMMAND make testv "EXIV2_BINDIR=${CMAKE_BINARY_DIR}/bin" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/test/" )
ADD_CUSTOM_TARGET(tests COMMAND make test "EXIV2_BINDIR=${CMAKE_BINARY_DIR}/bin" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/test/" )
ADD_CUSTOM_TARGET(teste COMMAND make teste "EXIV2_BINDIR=${CMAKE_BINARY_DIR}/bin" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/test/" )
ADD_CUSTOM_TARGET(testv COMMAND make testv "EXIV2_BINDIR=${CMAKE_BINARY_DIR}/bin" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/test/" )
ADD_CUSTOM_TARGET(testvw COMMAND make testvw "EXIV2_BINDIR=${CMAKE_BINARY_DIR}/bin" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/test/" )
ADD_CUSTOM_TARGET(testx COMMAND make testx "EXIV2_BINDIR=${CMAKE_BINARY_DIR}/bin" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/test/" )
##
# http://dev.exiv2.org/boards/3/topics/1364
# effectively does a make doc on the root directory
+14 -32
View File
@@ -1,6 +1,6 @@
# ***************************************************** -*- Makefile -*-
#
# Copyright (C) 2004-2013 Andreas Huggel <ahuggel@gmx.net>
# Copyright (C) 2004-2012 Andreas Huggel <ahuggel@gmx.net>
#
# This Makefile is part of the Exiv2 distribution.
#
@@ -71,36 +71,13 @@ samples: config/config.mk
cd samples && $(MAKE) $(MAKECMDGOALS)
tests:
@if [ ! -d test ]; then \
echo "*** directory test not available ***" ; \
echo "*** see http://dev.exiv2.org/projects/exiv2/wiki/How_do_I_build_Exiv2_on_the_XYZ_platform for more information ***" ; \
else \
cd test && $(MAKE) test ; \
fi
cd test && $(MAKE) test
teste:
@if [ ! -d test ]; then \
echo "*** directory test not available ***" ; \
echo "*** see http://dev.exiv2.org/projects/exiv2/wiki/How_do_I_build_Exiv2_on_the_XYZ_platform for more information ***" ; \
else \
cd test && $(MAKE) teste ; \
fi
teste testx testv:
cd test && $(MAKE) $@
testv:
@if [ ! -d test ]; then \
echo "*** directory test not available ***" ; \
echo "*** see http://dev.exiv2.org/projects/exiv2/wiki/How_do_I_build_Exiv2_on_the_XYZ_platform for more information ***" ; \
else \
cd test && $(MAKE) testv ; \
fi
testvw:
@if [ ! -d test ]; then \
echo "*** directory test not available ***" ; \
echo "*** see http://dev.exiv2.org/projects/exiv2/wiki/How_do_I_build_Exiv2_on_the_XYZ_platform for more information ***" ; \
else \
cd test && $(MAKE) testvw ; \
fi
exiv2 conntest exifprint remotetest:
cd src && $(MAKE) $0
MAJOR=$(shell grep "define.*EXIV2_.*_VERSION .*\\d*" src/version.hpp | grep MAJOR | sed -e 's/EXIV2//g' | tr -dC [:digit:])
MINOR=$(shell grep "define.*EXIV2_.*_VERSION .*\\d*" src/version.hpp | grep MINOR | sed -e 's/EXIV2//g' | tr -dC [:digit:])
@@ -126,8 +103,11 @@ configure:
config:
cd config && $(MAKE) -f config.make $(MAKECMDGOALS)
xmpsdk: config/config.mk
xmpsdk: src/svn_version.h config/config.mk
if test "x$(ENABLE_XMP)" = "x1"; then cd xmpsdk/src && $(MAKE) $@; fi;
src/svn_version.h:
cd src && $(MAKE) svn_version.h
mostlyclean clean: config/config.mk
cd src && $(MAKE) $(MAKECMDGOALS)
@@ -136,6 +116,8 @@ mostlyclean clean: config/config.mk
cd xmpsdk/src && $(MAKE) $(MAKECMDGOALS)
cd config && $(MAKE) -f config.make $(MAKECMDGOALS)
cd po && $(MAKE) $(MAKECMDGOALS)
rm -rf test/tmp include/exiv2/exv_conf.h src/svn_version.h
mkdir test/tmp
# `make distclean' also removes files created by configuring
# the program. Running `make all distclean' prepares the project
@@ -143,7 +125,7 @@ mostlyclean clean: config/config.mk
distclean: clean
rm -f config.log config.status libtool
rm -f *~ *.bak
rm -rf bin
if [ -e bin ]; then rm -rf bin ; fi
# This removes almost everything, including the configure script!
maintainer-clean: distclean
@@ -160,6 +142,6 @@ rebuild:
make
sudo make install
make samples
# That's all Folks!
##
+35 -9
View File
@@ -55,6 +55,32 @@ IF( EXIV2_ENABLE_PNG )
SET (HAVE_LIBZ ${ZLIB_FOUND})
ENDIF( EXIV2_ENABLE_PNG )
IF( EXIV2_ENABLE_CURL )
FIND_PACKAGE( CURL )
INCLUDE_DIRECTORIES( ${CURL_INCLUDE_DIR} )
# FindCURL.cmake doesn't check for REQUIRED flags - so we need to check ourselves
IF( MINGW OR UNIX )
IF (NOT CURL_FOUND)
MESSAGE(FATAL_ERROR "missing library curl required for HttpIo")
ELSE (NOT CURL_FOUND)
SET ( USE_CURL 1 )
ENDIF( NOT CURL_FOUND )
ENDIF( MINGW OR UNIX )
ENDIF( EXIV2_ENABLE_CURL )
IF( EXIV2_ENABLE_SSH )
FIND_PACKAGE( SSH )
INCLUDE_DIRECTORIES( ${SSH_INCLUDE_DIR} )
# FindSSH.cmake doesn't check for REQUIRED flags - so we need to check ourselves
IF( MINGW OR UNIX )
IF (NOT SSH_FOUND)
MESSAGE(FATAL_ERROR "missing library libssh required for SshIo")
ELSE (NOT SSH_FOUND)
SET ( USE_SSH 1 )
ENDIF( NOT SSH_FOUND )
ENDIF( MINGW OR UNIX )
ENDIF( EXIV2_ENABLE_SSH )
IF (EXIV2_ENABLE_XMP)
FIND_PACKAGE(EXPAT)
INCLUDE_DIRECTORIES(${EXPAT_INCLUDE_DIR})
@@ -160,16 +186,12 @@ ENDIF( HAVE_SYS_TIME_H )
#####################################################################################
# strerror_r returns char*
# NOTE : adding #if _POSIX code for #697
# NOTE : reverting commit #2041, which break compilation under linux and windows
CHECK_C_SOURCE_COMPILES( "#include <string.h>
int main() {
char * c;
#if (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && ! _GNU_SOURCE
int l = strerror_r(0,c,0);
if ( l ) return 0 ;
#else
c = strerror_r(0,c,0);
#endif
return 0;
}" STRERROR_R_CHAR_P )
@@ -230,6 +252,8 @@ SET( EXV_SYMBOLS ENABLE_NLS
HAVE_WCHAR_H
HAVE_XMP_TOOLKIT
HAVE__BOOL
USE_CURL
USE_SSH
PACKAGE
PACKAGE_BUGREPORT
PACKAGE_NAME
@@ -245,10 +269,10 @@ FOREACH( entry ${EXV_SYMBOLS} )
# MESSAGE( EXV_${entry} " : " ${${entry}} )
ENDFOREACH( entry ${EXV_SYMBOLS} )
CONFIGURE_FILE( config/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/exv_conf.h )
CONFIGURE_FILE( config/config.h.cmake ${CMAKE_SOURCE_DIR}/include/exiv2/exv_conf.h )
CONFIGURE_FILE( config/exv_msvc.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/exv_msvc.h COPYONLY )
INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/exv_conf.h DESTINATION include/exiv2 )
INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/exv_msvc.h DESTINATION include/exiv2 )
INSTALL( FILES ${CMAKE_SOURCE_DIR}/include/exiv2/exv_conf.h DESTINATION include/exiv2 )
INSTALL( FILES ${CMAKE_SOURCE_DIR}/include/exiv2/exv_msvc.h DESTINATION include/exiv2 )
CONFIGURE_FILE(config/exiv2_uninstall.cmake ${CMAKE_BINARY_DIR}/cmake_uninstall.cmake COPYONLY)
ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake")
@@ -283,4 +307,6 @@ OptionOutput( "Nikon lens database: " EXIV2_ENABLE_LENSDATA
OptionOutput( "Commercial build: " EXIV2_ENABLE_COMMERCIAL )
OptionOutput( "Build the unit tests: " EXIV2_ENABLE_BUILD_SAMPLES )
OptionOutput( "Building translations files: " EXIV2_ENABLE_BUILD_PO )
OptionOutput( "USE Libcurl for HttpIo: " EXIV2_ENABLE_CURL )
OptionOutput( "USE Libssh for SshIo: " EXIV2_ENABLE_SSH )
MESSAGE( STATUS "------------------------------------------------------------------" )
+1 -1
View File
@@ -668,7 +668,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = ../src/
INPUT = ../src/ ../include/exiv2/
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+31
View File
@@ -0,0 +1,31 @@
# - Find libssh
# Find the native SSH headers and libraries.
#
# SSH_INCLUDE_DIRS - where to find libssh.h, etc.
# SSH_LIBRARIES - List of libraries when using libssh.
# SSH_FOUND - True if libssh found.
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
# Look for the header file.
FIND_PATH(SSH_INCLUDE_DIR NAMES libssh/libssh.h)
# Look for the library.
FIND_LIBRARY(SSH_LIBRARY NAMES ssh libssh)
# handle the QUIETLY and REQUIRED arguments and set SSH_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SSH DEFAULT_MSG SSH_LIBRARY SSH_INCLUDE_DIR)
# Copy the results to the output variables.
IF(SSH_FOUND)
SET(SSH_LIBRARIES ${SSH_LIBRARY})
SET(SSH_INCLUDE_DIRS ${SSH_INCLUDE_DIR})
ELSE(SSH_FOUND)
SET(SSH_LIBRARIES)
SET(SSH_INCLUDE_DIRS)
ENDIF(SSH_FOUND)
MARK_AS_ADVANCED(SSH_INCLUDE_DIR SSH_LIBRARY)
+14 -32
View File
@@ -1,6 +1,6 @@
# ***************************************************** -*- Makefile -*-
#
# Copyright (C) 2004-2013 Andreas Huggel <ahuggel@gmx.net>
# Copyright (C) 2004-2012 Andreas Huggel <ahuggel@gmx.net>
#
# This Makefile is part of the Exiv2 distribution.
#
@@ -71,36 +71,13 @@ samples: config/config.mk
cd samples && $(MAKE) $(MAKECMDGOALS)
tests:
@if [ ! -d test ]; then \
echo "*** directory test not available ***" ; \
echo "*** see http://dev.exiv2.org/projects/exiv2/wiki/How_do_I_build_Exiv2_on_the_XYZ_platform for more information ***" ; \
else \
cd test && $(MAKE) test ; \
fi
cd test && $(MAKE) test
teste:
@if [ ! -d test ]; then \
echo "*** directory test not available ***" ; \
echo "*** see http://dev.exiv2.org/projects/exiv2/wiki/How_do_I_build_Exiv2_on_the_XYZ_platform for more information ***" ; \
else \
cd test && $(MAKE) teste ; \
fi
teste testx testv:
cd test && $(MAKE) $@
testv:
@if [ ! -d test ]; then \
echo "*** directory test not available ***" ; \
echo "*** see http://dev.exiv2.org/projects/exiv2/wiki/How_do_I_build_Exiv2_on_the_XYZ_platform for more information ***" ; \
else \
cd test && $(MAKE) testv ; \
fi
testvw:
@if [ ! -d test ]; then \
echo "*** directory test not available ***" ; \
echo "*** see http://dev.exiv2.org/projects/exiv2/wiki/How_do_I_build_Exiv2_on_the_XYZ_platform for more information ***" ; \
else \
cd test && $(MAKE) testvw ; \
fi
exiv2 conntest exifprint remotetest:
cd src && $(MAKE) $0
MAJOR=$(shell grep "define.*EXIV2_.*_VERSION .*\\d*" src/version.hpp | grep MAJOR | sed -e 's/EXIV2//g' | tr -dC [:digit:])
MINOR=$(shell grep "define.*EXIV2_.*_VERSION .*\\d*" src/version.hpp | grep MINOR | sed -e 's/EXIV2//g' | tr -dC [:digit:])
@@ -126,8 +103,11 @@ configure:
config:
cd config && $(MAKE) -f config.make $(MAKECMDGOALS)
xmpsdk: config/config.mk
xmpsdk: src/svn_version.h config/config.mk
if test "x$(ENABLE_XMP)" = "x1"; then cd xmpsdk/src && $(MAKE) $@; fi;
src/svn_version.h:
cd src && $(MAKE) svn_version.h
mostlyclean clean: config/config.mk
cd src && $(MAKE) $(MAKECMDGOALS)
@@ -136,6 +116,8 @@ mostlyclean clean: config/config.mk
cd xmpsdk/src && $(MAKE) $(MAKECMDGOALS)
cd config && $(MAKE) -f config.make $(MAKECMDGOALS)
cd po && $(MAKE) $(MAKECMDGOALS)
rm -rf test/tmp include/exiv2/exv_conf.h src/svn_version.h
mkdir test/tmp
# `make distclean' also removes files created by configuring
# the program. Running `make all distclean' prepares the project
@@ -143,7 +125,7 @@ mostlyclean clean: config/config.mk
distclean: clean
rm -f config.log config.status libtool
rm -f *~ *.bak
rm -rf bin
if [ -e bin ]; then rm -rf bin ; fi
# This removes almost everything, including the configure script!
maintainer-clean: distclean
@@ -160,6 +142,6 @@ rebuild:
make
sudo make install
make samples
# That's all Folks!
##
+13 -7
View File
@@ -1,6 +1,12 @@
/**/
/* config.h. Generated by cmake from config.h.cmake. */
/* Define to 1 if you want to use `libssh' for SshIO. */
#cmakedefine EXV_USE_SSH 1
/* Define to 1 if you want to use `libcurl' in httpIO. */
#cmakedefine EXV_USE_CURL 1
/* Define to 1 if you have the `alarm' function. */
#cmakedefine EXV_HAVE_ALARM
@@ -191,15 +197,16 @@ typedef int pid_t;
/* Define to `unsigned' if <sys/types.h> does not define. */
#cmakedefine size_t
#if defined __CYGWIN32__ && !defined __CYGWIN__
#if defined(__CYGWIN32__) && !defined(__CYGWIN__)
/* For backwards compatibility with Cygwin b19 and
earlier, we define __CYGWIN__ here, so that
we can rely on checking just for that macro. */
#define __CYGWIN__ __CYGWIN32__
#define EXV_HAVE_GXXCLASSVISIBILITY
#endif
/* File path seperator */
#if defined WIN32 && !defined __CYGWIN__
#if defined(WIN32) && !defined(__CYGWIN__)
#define EXV_SEPERATOR_STR "\\"
#define EXV_SEPERATOR_CHR '\\'
#else
@@ -208,7 +215,7 @@ typedef int pid_t;
#endif
/* Shared library support, see http://gcc.gnu.org/wiki/Visibility */
#ifdef WIN32
#if defined(WIN32) && !defined(__CYGWIN__)
# define EXV_IMPORT __declspec(dllimport)
# define EXV_EXPORT __declspec(dllexport)
# define EXV_DLLLOCAL
@@ -248,8 +255,8 @@ typedef int pid_t;
#endif
/*
If you're using Solaris and the Solaris Studio compiler, then you really
do need to use -library=stdcxx4 along with these inclusions below
If you're using Solaris and the Solaris Studio compiler
you must -library=stdcxx4 along with these inclusions below
*/
#if defined(OS_SOLARIS)
#include <stdio.h>
@@ -261,5 +268,4 @@ typedef int pid_t;
#include <ios>
#include <fstream>
#endif
#endif
#endif
+15
View File
@@ -1,5 +1,18 @@
#ifndef __CONFIG__H__
#define __CONFIG__H__
#ifdef _MSC_VER
# include "exv_msvc.h"
#else
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you want to use libssh */
#undef USE_SSH
/* Define to 1 if you want to use libcurl in httpIo */
#undef USE_CURL
/* Define to 1 if you have the `alarm' function. */
#undef HAVE_ALARM
@@ -263,3 +276,5 @@
#endif
#endif
#endif
#endif
+1 -1
View File
@@ -1,6 +1,6 @@
# ***************************************************** -*- Makefile -*-
#
# Copyright (C) 2004-2013 Andreas Huggel <ahuggel@gmx.net>
# Copyright (C) 2004-2012 Andreas Huggel <ahuggel@gmx.net>
#
# This Makefile is part of the Exiv2 distribution.
#
+45 -35
View File
@@ -1,6 +1,6 @@
# ***************************************************** -*- Makefile -*-
#
# Copyright (C) 2004-2013 Andreas Huggel <ahuggel@gmx.net>
# Copyright (C) 2004-2012 Andreas Huggel <ahuggel@gmx.net>
#
# This Makefile is part of the Exiv2 distribution.
#
@@ -58,16 +58,16 @@ GXX = @GXX@
# Common compiler flags (warnings, symbols [-ggdb], optimization [-O2], etc)
CXXFLAGS = @CXXFLAGS@
ifeq ($(GXX),yes)
CXXFLAGS += -Wall -Wcast-align -Wpointer-arith -Wformat-security -Wmissing-format-attribute -Woverloaded-virtual -W
CXXFLAGS += -Wall -Wcast-align -Wpointer-arith -Wformat-security -Wmissing-format-attribute -Woverloaded-virtual -W
endif
# Command to run only the preprocessor
CXXCPP = @CXXCPP@
# Preprocessor flags
CPPFLAGS = -I. @CPPFLAGS@ -DEXV_LOCALEDIR=\"$(localedir)\"
CPPFLAGS = -I../src -I../include/ -I../include/exiv2 @CPPFLAGS@ -DEXV_LOCALEDIR=\"$(localedir)\"
ifeq ($(COMMERCIAL_VERSION),yes)
CPPFLAGS += -DEXV_COMMERCIAL_VERSION=1
CPPFLAGS += -DEXV_COMMERCIAL_VERSION=1
endif
# Linker flags and libraries
@@ -84,7 +84,7 @@ GCC = @GCC@
CFLAGS = @CFLAGS@
ifeq ($(GCC),yes)
CFLAGS += -Wall
CFLAGS += -Wall
endif
# **********************************************************************
@@ -92,19 +92,29 @@ endif
ENABLE_XMP = @ENABLE_XMP@
ifdef ENABLE_XMP
XMPSDK_LIBRARY = xmpsdk
XMPSDK_DIR = $(top_srcdir)/xmpsdk
XMPSDK_CPPFLAGS = -I$(XMPSDK_DIR)/include
XMPSDK_LDFLAGS = -L$(XMPSDK_DIR)/src
XMPSDK_LIBS = -l$(XMPSDK_LIBRARY)
XMPSDK_LIBRARY = xmpsdk
XMPSDK_DIR = $(top_srcdir)/xmpsdk
XMPSDK_CPPFLAGS = -I$(XMPSDK_DIR)/include
XMPSDK_LDFLAGS = -L$(XMPSDK_DIR)/src
XMPSDK_LIBS = -l$(XMPSDK_LIBRARY)
else
# Enable additional warnings. XMP Toolkit doesn't compile
# with these.
ifeq ($(GXX),yes)
CXXFLAGS += -Wundef -pedantic
endif
# Enable additional warnings. XMP Toolkit doesn't compile
# with these.
ifeq ($(GXX),yes)
CXXFLAGS += -Wundef -pedantic
endif
endif
# Libcurl need for httpIO if it's selected
CURL_CPPFLAGS = @CURL_CPPFLAGS@
CURL_LDFLAGS = @CURL_LDFLAGS@
CURL_LIBS = @CURL_LIBS@
# Libssh need for SshIO if it's selected
SSH_CPPFLAGS = @SSH_CPPFLAGS@
SSH_LDFLAGS = @SSH_LDFLAGS@
SSH_LIBS = @SSH_LIBS@
# Expat library needed to compile the XMP Toolkit
EXPAT_LDFLAGS = @EXPAT_LDFLAGS@
EXPAT_CPPFLAGS = @EXPAT_CPPFLAGS@
@@ -122,29 +132,29 @@ HAVE_TIMEGM = @HAVE_TIMEGM@
DEP_TRACKING = @DEP_TRACKING@
ifdef DEP_TRACKING
# Directory for dependency files
DEPDIR = .deps
# Directory for dependency files
DEPDIR = .deps
# Command to run the compiler or preprocessor to produce
# dependencies. If you're not using gcc, you may need to change
# this to something suitable for your compiler or simply unset
# the variable. See the link above for suggestions.
MAKEDEPEND = $(CXX) -MM $(CPPFLAGS) -o $*.d $<
# Command to run the compiler or preprocessor to produce
# dependencies. If you're not using gcc, you may need to change
# this to something suitable for your compiler or simply unset
# the variable. See the link above for suggestions.
MAKEDEPEND = $(CXX) -MM $(CPPFLAGS) -o $*.d $<
# Dependency files post-process commands
POSTDEPEND = if test ! -d $(DEPDIR); then mkdir $(DEPDIR); fi; \
if test -e $*.d; then cp $*.d $(DEPDIR)/$*.d; \
sed -e 's/^\#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
# Dependency files post-process commands
POSTDEPEND = if test ! -d $(DEPDIR); then mkdir $(DEPDIR); fi; \
if test -e $*.d; then cp $*.d $(DEPDIR)/$*.d; \
sed -e 's/^\#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $(DEPDIR)/$*.d; \
$(RM) $*.d; fi
$(RM) $*.d; fi
# Compiler flags to generate dependency files at the same time
# as object files (for gcc)
ifeq ($(GXX),yes)
CXXFLAGS += -MMD
CFLAGS += -MMD
MAKEDEPEND =
endif
# Compiler flags to generate dependency files at the same time
# as object files (for gcc)
ifeq ($(GXX),yes)
CXXFLAGS += -MMD
CFLAGS += -MMD
MAKEDEPEND =
endif
endif
# **********************************************************************
@@ -153,7 +163,7 @@ COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c
COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
# LINK.cc does not need $(LIBS), libtool's dark magic takes care of that
# when linking a binary with a libtool library.
LINK.cc = $(CXX) $(LDFLAGS)
LINK.cc = $(CXX) $(LDFLAGS) -ldl
# **********************************************************************
# Installation programs
+102 -3
View File
@@ -151,6 +151,86 @@ AC_ARG_ENABLE(xmp,
USE_XMP_TOOLKIT=$enableval, USE_XMP_TOOLKIT=yes)
AC_MSG_RESULT($USE_XMP_TOOLKIT)
# libcurl option might change flags, so we save them initially
_cppflags="${CPPFLAGS}"
_ldflags="${LDFLAGS}"
AC_ARG_WITH(curl,
[ --with-curl[[=DIR]] use libcurl in DIR],[
if test "$withval" != "no" -a "$withval" != "yes"; then
CURL_DIR=$withval
CPPFLAGS="${CPPFLAGS} -I$withval/include"
LDFLAGS="${LDFLAGS} -L$withval/lib"
fi
])
USE_CURL=
if test "$with_curl" != "no"; then
# Check for libcurl library
found_curl=yes
CURL_CPPFLAGS=
CURL_LDFLAGS=
CURL_LIBS=
AC_CHECK_HEADERS(curl/curl.h,
AC_CHECK_LIB(curl, curl_easy_init,[
USE_CURL=yes
AC_DEFINE([USE_CURL], [1], [Use libcurl library])
CURL_LIBS="-lcurl"
if test "x${CURL_DIR}" != "x"; then
CURL_CPPFLAGS="-I${CURL_DIR}/include"
CURL_LDFLAGS="-L${CURL_DIR}/lib"
fi],[found_curl=no]),[found_curl=no])
if test "$found_curl" = "no"; then
AC_MSG_ERROR(either specify a valid curl installation with --with-curl=DIR or disable libcurl support with --disable-curl)
fi
AC_SUBST(CURL_CPPFLAGS)
AC_SUBST(CURL_LDFLAGS)
AC_SUBST(CURL_LIBS)
fi
CPPFLAGS=${_cppflags}
LDFLAGS=${_ldflags}
# libssh option might change flags, so we save them initially
_cppflags="${CPPFLAGS}"
_ldflags="${LDFLAGS}"
AC_ARG_WITH(ssh,
[ --with-ssh[[=DIR]] use libssh in DIR],[
if test "$withval" != "no" -a "$withval" != "yes"; then
SSH_DIR=$withval
CPPFLAGS="${CPPFLAGS} -I$withval/include"
LDFLAGS="${LDFLAGS} -L$withval/lib"
fi
])
USE_SSH=
if test "$with_ssh" != "no"; then
# Check for libssh library
found_ssh=yes
SSH_CPPFLAGS=
SSH_LDFLAGS=
SSH_LIBS=
AC_CHECK_HEADERS(libssh/libssh.h,
AC_CHECK_LIB(ssh, ssh_new,[
USE_SSH=yes
AC_DEFINE([USE_SSH], [1], [Use libssh library])
SSH_LIBS="-lssh"
if test "x${SSH_DIR}" != "x"; then
SSH_CPPFLAGS="-I${SSH_DIR}/include"
SSH_LDFLAGS="-L${SSH_DIR}/lib"
fi],[found_ssh=no]),[found_ssh=no])
if test "$found_ssh" = "no"; then
AC_MSG_ERROR(either specify a valid libssh installation with --with-ssh=DIR or disable libssh support with --disable-ssh)
fi
AC_SUBST(SSH_CPPFLAGS)
AC_SUBST(SSH_LDFLAGS)
AC_SUBST(SSH_LIBS)
fi
CPPFLAGS=${_cppflags}
LDFLAGS=${_ldflags}
# expat option might change flags, so we save them initially
_cppflags="${CPPFLAGS}"
_ldflags="${LDFLAGS}"
@@ -211,13 +291,10 @@ AC_SUBST(EXV_LIB_STATIC)
# version.cpp requires link to psapi/Windows and dl/Unix builds
case "$host_os" in
*mingw* | *cygwin*)
EXV_LIBPSAPI="-lpsapi"
LDFLAGS="$LDFLAGS -no-undefined -lpsapi" ;;
*)
EXV_LIBPSAPI=
LDFLAGS="$LDFLAGS -ldl" ;;
esac
AC_SUBST(EXV_LIBPSAPI)
# ---------------------------------------------------------------------------
# Create output files.
@@ -284,6 +361,28 @@ yes) echo "-- XMP metadata support........... YES" ;;
echo "" ;;
esac
case "$USE_CURL" in
yes) echo "-- Using Lib Curl................. YES" ;;
*) echo "-- Using Lib Curl................. NO"
echo ""
echo "Libcurl is required for HttpIo in basicIo.cpp. Make sure the Curl header"
echo "files are installed and use --with-curl=DIR if it is in a"
echo "non-standard location. You can get Curl from"
echo "http://curl.haxx.se/libcurl/"
echo "" ;;
esac
case "$USE_SSH" in
yes) echo "-- Using Lib SSH.................. YES" ;;
*) echo "-- Using Lib SSH.................. NO"
echo ""
echo "Libssh is required for SshIo in basicIo.cpp. Make sure the libssh header"
echo "files are installed and use --with-ssh=DIR if it is in a"
echo "non-standard location. You can get libssh from"
echo "http://www.libssh.org/get-it/"
echo "" ;;
esac
echo "------------------------------------------------------------------"
echo ""
+1 -1
View File
@@ -7,5 +7,5 @@ Name: exiv2
Description: Image metadata library and tools
Version: @PACKAGE_VERSION@
Libs: -L${libdir} -lexiv2 @EXV_LIB_STATIC@
Libs.private: @EXPAT_LDFLAGS@ @LTLIBINTL@ @LTLIBICONV@ @LIBS@ @EXPAT_LIBS@ @EXV_LIBPSAPI@
Libs.private: @EXPAT_LDFLAGS@ @SSH_LDFLAGS@ @CURL_LDFLAGS@ @LTLIBINTL@ @LTLIBICONV@ @LIBS@ @EXPAT_LIBS@ @SSH_LIBS@ @CURL_LIBS@
Cflags: -I${includedir}
+474
View File
@@ -0,0 +1,474 @@
/*
Copyright (c) 2013 Johannes Häggqvist
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef Jzon_h__
#define Jzon_h__
#ifndef JzonAPI
# ifdef _WINDLL
# define JzonAPI __declspec(dllimport)
# elif defined(__GNUC__) && (__GNUC__ >= 4)
# define JzonAPI __attribute__ ((visibility("default")))
# else
# define JzonAPI
# endif
#endif
#include <string>
#include <vector>
#include <queue>
#include <iterator>
#include <stdexcept>
namespace Jzon
{
#ifdef _MSC_VER
# pragma warning(disable : 4251)
#endif
template<typename T1, typename T2>
struct Pair
{
Pair(T1 first, T2 second) : first(first), second(second)
{}
Pair &operator=(const Pair &rhs)
{
if (this != &rhs)
{
this->first = rhs.first;
this->second = rhs.second;
}
return *this;
}
T1 first;
T2 second;
};
template<typename T1, typename T2>
static Pair<T1, T2> MakePair(T1 first, T2 second)
{
return Pair<T1, T2>(first, second);
}
class Node;
class Value;
class Object;
class Array;
typedef Pair<std::string, Node&> NamedNode;
typedef Pair<std::string, Node*> NamedNodePtr;
class TypeException : public std::logic_error
{
public:
TypeException() : std::logic_error("A Node was used as the wrong type")
{}
};
class NotFoundException : public std::out_of_range
{
public:
NotFoundException() : std::out_of_range("The node could not be found")
{}
};
struct Format
{
bool newline;
bool spacing;
bool useTabs;
unsigned int indentSize;
};
static const Format StandardFormat = { true, true, true, 1 };
static const Format NoFormat = { false, false, false, 0 };
class JzonAPI Node
{
friend class Object;
friend class Array;
public:
enum Type
{
T_OBJECT,
T_ARRAY,
T_VALUE
};
Node();
virtual ~Node();
virtual Type GetType() const = 0;
inline bool IsObject() const { return (GetType() == T_OBJECT); }
inline bool IsArray() const { return (GetType() == T_ARRAY); }
inline bool IsValue() const { return (GetType() == T_VALUE); }
Object &AsObject();
const Object &AsObject() const;
Array &AsArray();
const Array &AsArray() const;
Value &AsValue();
const Value &AsValue() const;
virtual inline bool IsNull() const { return false; }
virtual inline bool IsString() const { return false; }
virtual inline bool IsNumber() const { return false; }
virtual inline bool IsBool() const { return false; }
virtual std::string ToString() const { throw TypeException(); }
virtual int ToInt() const { throw TypeException(); }
virtual float ToFloat() const { throw TypeException(); }
virtual double ToDouble() const { throw TypeException(); }
virtual bool ToBool() const { throw TypeException(); }
virtual bool Has(const std::string &/*name*/) const { throw TypeException(); }
virtual size_t GetCount() const { return 0; }
virtual Node &Get(const std::string &/*name*/) const { throw TypeException(); }
virtual Node &Get(size_t /*index*/) const { throw TypeException(); }
static Type DetermineType(const std::string &json);
protected:
virtual Node *GetCopy() const = 0;
};
class JzonAPI Value : public Node
{
public:
enum ValueType
{
VT_NULL,
VT_STRING,
VT_NUMBER,
VT_BOOL
};
Value();
Value(const Value &rhs);
Value(const Node &rhs);
Value(ValueType type, const std::string &value);
Value(const std::string &value);
Value(const char *value);
Value(const int value);
Value(const float value);
Value(const double value);
Value(const bool value);
virtual ~Value();
virtual Type GetType() const;
ValueType GetValueType() const;
virtual inline bool IsNull() const { return (type == VT_NULL); }
virtual inline bool IsString() const { return (type == VT_STRING); }
virtual inline bool IsNumber() const { return (type == VT_NUMBER); }
virtual inline bool IsBool() const { return (type == VT_BOOL); }
virtual std::string ToString() const;
virtual int ToInt() const;
virtual float ToFloat() const;
virtual double ToDouble() const;
virtual bool ToBool() const;
void SetNull();
void Set(const Value &value);
void Set(ValueType type, const std::string &value);
void Set(const std::string &value);
void Set(const char *value);
void Set(const int value);
void Set(const float value);
void Set(const double value);
void Set(const bool value);
Value &operator=(const Value &rhs);
Value &operator=(const Node &rhs);
Value &operator=(const std::string &rhs);
Value &operator=(const char *rhs);
Value &operator=(const int rhs);
Value &operator=(const float rhs);
Value &operator=(const double rhs);
Value &operator=(const bool rhs);
bool operator==(const Value &other) const;
bool operator!=(const Value &other) const;
static std::string EscapeString(const std::string &value);
static std::string UnescapeString(const std::string &value);
protected:
virtual Node *GetCopy() const;
private:
std::string valueStr;
ValueType type;
};
static const Value null;
class JzonAPI Object : public Node
{
public:
class iterator : public std::iterator<std::input_iterator_tag, NamedNode>
{
public:
iterator(NamedNodePtr *o) : p(o) {}
iterator(const iterator &it) : p(it.p) {}
iterator &operator++() { ++p; return *this; }
iterator operator++(int) { iterator tmp(*this); operator++(); return tmp; }
bool operator==(const iterator &rhs) { return p == rhs.p; }
bool operator!=(const iterator &rhs) { return p != rhs.p; }
NamedNode operator*() { return NamedNode(p->first, *p->second); }
private:
NamedNodePtr *p;
};
class const_iterator : public std::iterator<std::input_iterator_tag, const NamedNode>
{
public:
const_iterator(const NamedNodePtr *o) : p(o) {}
const_iterator(const const_iterator &it) : p(it.p) {}
const_iterator &operator++() { ++p; return *this; }
const_iterator operator++(int) { const_iterator tmp(*this); operator++(); return tmp; }
bool operator==(const const_iterator &rhs) { return p == rhs.p; }
bool operator!=(const const_iterator &rhs) { return p != rhs.p; }
const NamedNode operator*() { return NamedNode(p->first, *p->second); }
private:
const NamedNodePtr *p;
};
Object();
Object(const Object &other);
Object(const Node &other);
virtual ~Object();
virtual Type GetType() const;
void Add(const std::string &name, Node &node);
void Add(const std::string &name, Value node);
void Remove(const std::string &name);
void Clear();
iterator begin();
const_iterator begin() const;
iterator end();
const_iterator end() const;
virtual bool Has(const std::string &name) const;
virtual size_t GetCount() const;
virtual Node &Get(const std::string &name) const;
using Node::Get;
protected:
virtual Node *GetCopy() const;
private:
typedef std::vector<NamedNodePtr> ChildList;
ChildList children;
};
class JzonAPI Array : public Node
{
public:
class iterator : public std::iterator<std::input_iterator_tag, Node>
{
public:
iterator(Node **o) : p(o) {}
iterator(const iterator &it) : p(it.p) {}
iterator &operator++() { ++p; return *this; }
iterator operator++(int) { iterator tmp(*this); operator++(); return tmp; }
bool operator==(const iterator &rhs) { return p == rhs.p; }
bool operator!=(const iterator &rhs) { return p != rhs.p; }
Node &operator*() { return **p; }
private:
Node **p;
};
class const_iterator : public std::iterator<std::input_iterator_tag, const Node>
{
public:
const_iterator(const Node *const *o) : p(o) {}
const_iterator(const const_iterator &it) : p(it.p) {}
const_iterator &operator++() { ++p; return *this; }
const_iterator operator++(int) { const_iterator tmp(*this); operator++(); return tmp; }
bool operator==(const const_iterator &rhs) { return p == rhs.p; }
bool operator!=(const const_iterator &rhs) { return p != rhs.p; }
const Node &operator*() { return **p; }
private:
const Node *const *p;
};
Array();
Array(const Array &other);
Array(const Node &other);
virtual ~Array();
virtual Type GetType() const;
void Add(Node &node);
void Add(Value node);
void Remove(size_t index);
void Clear();
iterator begin();
const_iterator begin() const;
iterator end();
const_iterator end() const;
virtual size_t GetCount() const;
virtual Node &Get(size_t index) const;
using Node::Get;
protected:
virtual Node *GetCopy() const;
private:
typedef std::vector<Node*> ChildList;
ChildList children;
};
class JzonAPI FileWriter
{
public:
FileWriter(const std::string &filename);
~FileWriter();
static void WriteFile(const std::string &filename, const Node &root, const Format &format = NoFormat);
void Write(const Node &root, const Format &format = NoFormat);
private:
std::string filename;
};
class JzonAPI FileReader
{
public:
FileReader(const std::string &filename);
~FileReader();
static bool ReadFile(const std::string &filename, Node &node);
bool Read(Node &node);
Node::Type DetermineType();
const std::string &GetError() const;
private:
bool loadFile(const std::string &filename, std::string &json);
std::string json;
std::string error;
};
class JzonAPI Writer
{
public:
Writer(const Node &root, const Format &format = NoFormat);
~Writer();
void SetFormat(const Format &format);
const std::string &Write();
// Return result from last call to Write()
const std::string &GetResult() const;
private:
void writeNode(const Node &node, unsigned int level);
void writeObject(const Object &node, unsigned int level);
void writeArray(const Array &node, unsigned int level);
void writeValue(const Value &node);
std::string result;
class FormatInterpreter *fi;
const Node &root;
// Disable assignment operator
Writer &operator=(const Writer&);
};
class JzonAPI Parser
{
public:
Parser(Node &root);
Parser(Node &root, const std::string &json);
~Parser();
void SetJson(const std::string &json);
bool Parse();
const std::string &GetError() const;
private:
enum Token
{
T_UNKNOWN,
T_OBJ_BEGIN,
T_OBJ_END,
T_ARRAY_BEGIN,
T_ARRAY_END,
T_SEPARATOR_NODE,
T_SEPARATOR_NAME,
T_VALUE
};
void tokenize();
bool assemble();
char peek();
void jumpToNext(char c);
void jumpToCommentEnd();
void readString();
bool interpretValue(const std::string &value);
std::string json;
std::size_t jsonSize;
std::queue<Token> tokens;
std::queue<Pair<Value::ValueType, std::string> > data;
std::size_t cursor;
Node &root;
std::string error;
// Disable assignment operator
Parser &operator=(const Parser&);
};
}
#endif // Jzon_h__
@@ -22,7 +22,7 @@
@file actions.hpp
@brief Implements base class Task, TaskFactory and the various supported
actions (derived from Task).
@version $Rev$
@version $Rev: 3091 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@date 11-Dec-03, ahu: created
+564 -11
View File
@@ -21,7 +21,7 @@
/*!
@file basicio.hpp
@brief Simple binary IO abstraction
@version $Rev$
@version $Rev: 3091 $
@author Brad Schick (brad)
<a href="mailto:brad@robotbattle.com">brad@robotbattle.com</a>
@date 04-Dec-04, brad: created
@@ -29,14 +29,23 @@
#ifndef BASICIO_HPP_
#define BASICIO_HPP_
// The way to handle data from stdin or data uri path. If XPATH_MEMIO = 1, it uses MemIo. Otherwises, it uses FileIo.
#ifndef XPATH_MEMIO
#define XPATH_MEMIO 0
#endif
// *****************************************************************************
// included header files
#include "types.hpp"
#include "futils.hpp"
// + standard includes
#include <string>
#include <memory> // for std::auto_ptr
#include <memory> // for std::auto_ptr
#include <fstream> // write the temporary file
#include <fcntl.h> // _O_BINARY in FileIo::FileIo
#include <ctime> // timestamp for the name of temporary file
#include <cstring> // std::memcpy
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
@@ -172,7 +181,7 @@ namespace Exiv2 {
#if defined(_MSC_VER)
virtual int seek(uint64_t offset, Position pos) = 0;
#else
virtual int seek(long offset, Position pos) = 0;
virtual int seek(long offset, Position pos) = 0;
#endif
/*!
@@ -241,6 +250,15 @@ namespace Exiv2 {
@throw Error In case of failure
*/
virtual BasicIo::AutoPtr temporary() const = 0;
/*!
@brief Mark all the bNone blocks to bKnow. This avoids allocating memory
for parts of the file that contain image-date (non-metadata/pixel data)
@note This method should be only called after the concerned data (metadata)
are all downloaded from the remote file to memory.
*/
virtual void populateFakeData() {}
//@}
protected:
@@ -264,7 +282,7 @@ namespace Exiv2 {
//! Constructor, takes a BasicIo reference
IoCloser(BasicIo& bio) : bio_(bio) {}
//! Destructor, closes the BasicIo reference
~IoCloser() { close(); }
virtual ~IoCloser() { close(); }
//@}
//! @name Manipulators
@@ -434,7 +452,7 @@ namespace Exiv2 {
#else
virtual int seek(long offset, Position pos);
#endif
/*!
/*!
@brief Map the file into the process's address space. The file must be
open before mmap() is called. If the mapped area is writeable,
changes may not be written back to the underlying file until
@@ -454,8 +472,19 @@ namespace Exiv2 {
Nonzero if failure;
*/
virtual int munmap();
/*!
@brief close the file source and set a new path.
*/
virtual void setPath(const std::string& path);
#ifdef EXV_UNICODE_PATH
/*!
@brief Like setPath(const std::string& path) but accepts a
unicode path in an std::wstring.
@note This method is only available on Windows.
*/
virtual void setPath(const std::wstring& wpath);
#endif
//@}
//! @name Accessors
//@{
/*!
@@ -496,6 +525,15 @@ namespace Exiv2 {
@throw Error If opening the temporary file fails
*/
virtual BasicIo::AutoPtr temporary() const;
/*!
@brief Mark all the bNone blocks to bKnow. This avoids allocating memory
for parts of the file that contain image-date (non-metadata/pixel data)
@note This method should be only called after the concerned data (metadata)
are all downloaded from the remote file to memory.
*/
virtual void populateFakeData();
//@}
private:
@@ -539,7 +577,7 @@ namespace Exiv2 {
*/
MemIo(const byte* data, long size);
//! Destructor. Releases all managed memory
~MemIo();
virtual ~MemIo();
//@}
//! @name Manipulators
@@ -644,7 +682,7 @@ namespace Exiv2 {
#if defined(_MSC_VER)
virtual int seek(uint64_t offset, Position pos);
#else
virtual int seek(long offset, Position pos);
virtual int seek(long offset, Position pos);
#endif
/*!
@brief Allow direct access to the underlying data buffer. The buffer
@@ -693,6 +731,16 @@ namespace Exiv2 {
@return An instance of BasicIo
*/
virtual BasicIo::AutoPtr temporary() const;
/*!
@brief Mark all the bNone blocks to bKnow. This avoids allocating memory
for parts of the file that contain image-date (non-metadata/pixel data)
@note This method should be only called after the concerned data (metadata)
are all downloaded from the remote file to memory.
*/
virtual void populateFakeData();
//@}
private:
@@ -708,6 +756,492 @@ namespace Exiv2 {
}; // class MemIo
/*!
@brief Provides binary IO for the data from stdin and data uri path.
*/
#if XPATH_MEMIO
class EXIV2API XPathIo : public MemIo {
public:
//! @name Creators
//@{
//! Default constructor
XPathIo(const std::string& path);
#ifdef EXV_UNICODE_PATH
/*!
@brief Like XPathIo(const std::string& path) but accepts a
unicode url in an std::wstring.
@note This constructor is only available on Windows.
*/
XPathIo(const std::wstring& wpath);
#endif
//@}
private:
/*!
@brief Read data from stdin and write the data to memory.
@throw Error if it can't convert stdin to binary.
*/
void ReadStdin();
/*!
@brief Read the data from data uri path and write the data to memory.
@param path The data uri.
@throw Error if no base64 data in path.
*/
void ReadDataUri(const std::string& path);
}; // class XPathIo
#else
class EXIV2API XPathIo : public FileIo {
public:
/*!
@brief The extention of the temporary file which is created when getting input data
to read metadata. This file will be deleted in destructor.
*/
static const std::string TEMP_FILE_EXT;
/*!
@brief The extention of the generated file which is created when getting input data
to add or modify the metadata.
*/
static const std::string GEN_FILE_EXT;
//! @name Creators
//@{
//! Default constructor that reads data from stdin/data uri path and writes them to the temp file.
XPathIo(const std::string& orgPath);
#ifdef EXV_UNICODE_PATH
/*!
@brief Like XPathIo(const std::string& orgPath) but accepts a
unicode url in an std::wstring.
@note This constructor is only available on Windows.
*/
XPathIo(const std::wstring& wOrgPathpath);
#endif
//! Destructor. Releases all managed memory and removes the temp file.
virtual ~XPathIo();
//@}
//! @name Manipulators
//@{
/*!
@brief Change the name of the temp file and make it untemporary before
calling the method of superclass FileIo::transfer.
*/
virtual void transfer(BasicIo& src);
//@}
//! @name Static methods
//@{
/*!
@brief Read the data from stdin/data uri path and write them to the file.
@param orgPath It equals "-" if the input data's from stdin. Otherwise, it's data uri path.
@return the name of the new file.
@throw Error if it fails.
*/
static std::string writeDataToFile(const std::string& orgPath);
#ifdef EXV_UNICODE_PATH
/*!
@brief Like writeDataToFile(const std::string& orgPath) but accepts a
unicode url in an std::wstring.
@note This constructor is only available on Windows.
*/
static std::string writeDataToFile(const std::wstring& wOrgPath);
#endif
//@}
private:
// True if the file is a temporary file and it should be deleted in destructor.
bool isTemp_;
std::string tempFilePath_;
}; // class XPathIo
#endif
/*!
@brief Utility class provides the block mapping to the part of data. This avoids allocating
a single contiguous block of memory to the big data.
*/
class EXIV2API BlockMap {
public:
//! the status of the block.
enum blockType_e {bNone, bKnown, bMemory};
//! @name Creators
//@{
//! Default constructor. the init status of the block is bNone.
BlockMap():type_(bNone), data_(NULL) {}
//! Destructor. Releases all managed memory.
virtual ~BlockMap() {
if (data_) {std::free(data_); data_ = NULL;}
}
//@}
//! @name Manipulators
//@{
/*!
@brief Populate the block.
@param source The data populate to the block
@param num The size of data
*/
void populate (byte* source, size_t num) {
size_ = num;
data_ = (byte*) std::malloc(size_);
type_ = bMemory;
std::memcpy(data_, source, size_);
}
/*!
@brief Change the status to bKnow. bKnow blocks do not contain the data,
but they keep the size of data. This avoids allocating memory for parts
of the file that contain image-date (non-metadata/pixel data) which never change in exiv2.
@param num The size of the data
*/
void markKnown(size_t num) {
type_ = bKnown;
size_ = num;
}
//@}
//! @name Accessors
//@{
bool isNone() {return type_ == bNone;}
bool isInMem () {return type_ == bMemory;}
bool isKnown () {return type_ == bKnown;}
byte* getData () {return data_;}
size_t getSize () {return size_;}
//@}
private:
blockType_e type_;
byte* data_;
size_t size_;
}; // class BlockMap
/*!
@brief Provides remote binary file IO by implementing the BasicIo interface. This is an
abstract class. The logics for remote access are implemented in HttpIo, CurlIo, SshIo which
are the derived classes of RemoteIo.
*/
class EXIV2API RemoteIo : public BasicIo {
public:
//! Destructor. Releases all managed memory.
virtual ~RemoteIo();
//@}
//! @name Manipulators
//@{
/*!
@brief Connect to the remote server, get the size of the remote file and
allocate the array of blocksMap.
If the blocksMap is already allocated (this method has been called before),
it just reset IO position to the start and does not flush the old data.
@return 0 if successful;<BR>
Nonzero if failure.
*/
virtual int open();
/*!
@brief Reset the IO position to the start. It does not release the data.
@return 0 if successful;<BR>
Nonzero if failure.
*/
virtual int close();
/*!
@brief Not support this method.
@return 0 means failure
*/
virtual long write(const byte* data, long wcount);
/*!
@brief Write data that is read from another BasicIo instance to the remote file.
The write access is done in an efficient way. It only sends the range of different
bytes between the current data and BasicIo instance to the remote machine.
@param src Reference to another BasicIo instance. Reading start
at the source's current IO position
@return The size of BasicIo instance;<BR>
0 if failure;
@throw Error In case of failure
@note The write access is only supported by http, https, ssh.
*/
virtual long write(BasicIo& src);
/*!
@brief Not support
@return 0 means failure
*/
virtual int putb(byte data);
/*!
@brief Read data from the memory blocks. Reading starts at the current
IO position and the position is advanced by the number of
bytes read.
If the memory blocks are not populated (False), it will connect to server
and populate the data to memory blocks.
@param rcount Maximum number of bytes to read. Fewer bytes may be
read if \em rcount bytes are not available.
@return DataBuf instance containing the bytes read. Use the
DataBuf::size_ member to find the number of bytes read.
DataBuf::size_ will be 0 on failure.
*/
virtual DataBuf read(long rcount);
/*!
@brief Read data from the the memory blocks. Reading starts at the current
IO position and the position is advanced by the number of
bytes read.
If the memory blocks are not populated (!= bMemory), it will connect to server
and populate the data to memory blocks.
@param buf Pointer to a block of memory into which the read data
is stored. The memory block must be at least \em rcount bytes
long.
@param rcount Maximum number of bytes to read. Fewer bytes may be
read if \em rcount bytes are not available.
@return Number of bytes read from the memory block successfully;<BR>
0 if failure;
*/
virtual long read(byte* buf, long rcount);
/*!
@brief Read one byte from the memory blocks. The IO position is
advanced by one byte.
If the memory block is not populated (!= bMemory), it will connect to server
and populate the data to the memory block.
@return The byte read from the memory block if successful;<BR>
EOF if failure;
*/
virtual int getb();
/*!
@brief Remove the contents of the file and then transfer data from
the \em src BasicIo object into the empty file.
The write access is done in an efficient way. It only sends the range of different
bytes between the current data and BasicIo instance to the remote machine.
@param src Reference to another BasicIo instance. The entire contents
of src are transferred to this object. The \em src object is
invalidated by the method.
@throw Error In case of failure
@note The write access is only supported by http, https, ssh.
*/
virtual void transfer(BasicIo& src);
/*!
@brief Move the current IO position.
@param offset Number of bytes to move the IO position
relative to the starting position specified by \em pos
@param pos Position from which the seek should start
@return 0 if successful;<BR>
Nonzero if failure;
*/
#if defined(_MSC_VER)
virtual int seek(uint64_t offset, Position pos);
#else
virtual int seek(long offset, Position pos);
#endif
/*!
@brief Not support
@return NULL
*/
virtual byte* mmap(bool /*isWriteable*/ =false);
/*!
@brief Not support
@return 0
*/
virtual int munmap();
//@}
//! @name Accessors
//@{
/*!
@brief Get the current IO position.
@return Offset from the start of the memory block
*/
virtual long tell() const;
/*!
@brief Get the current memory buffer size in bytes.
@return Size of the in memory data in bytes;<BR>
-1 if failure;
*/
virtual long size() const;
//!Returns true if the memory area is allocated.
virtual bool isopen() const;
//!Always returns 0
virtual int error() const;
//!Returns true if the IO position has reach the end, otherwise false.
virtual bool eof() const;
//!Returns the URL of the file.
virtual std::string path() const;
#ifdef EXV_UNICODE_PATH
/*
@brief Like path() but returns a unicode URL path in an std::wstring.
@note This function is only available on Windows.
*/
virtual std::wstring wpath() const;
#endif
/*!
@brief Returns a temporary data storage location. Currently returns
an empty MemIo object, but callers should not rely on this
behavior since it may change.
@return An instance of BasicIo
*/
virtual BasicIo::AutoPtr temporary() const;
/*!
@brief Mark all the bNone blocks to bKnow. This avoids allocating memory
for parts of the file that contain image-date (non-metadata/pixel data)
@note This method should be only called after the concerned data (metadata)
are all downloaded from the remote file to memory.
*/
virtual void populateFakeData();
//@}
protected:
//! @name Creators
//@{
//! Default Constructor
RemoteIo() {p_=NULL;}
//@}
// Pimpl idiom
class Impl;
Impl* p_;
}; // class RemoteIo
/*!
@brief Provides the http read/write access for the RemoteIo.
*/
class EXIV2API HttpIo : public RemoteIo {
public:
//! @name Creators
//@{
/*!
@brief Constructor that accepts the http URL on which IO will be
performed. The constructor does not open the file, and
therefore never failes.
@param url The full path of url
@param blockSize the size of the memory block. The file content is
divided into the memory blocks. These blocks are populated
on demand from the server, so it avoids copying the complete file.
*/
HttpIo(const std::string& url, size_t blockSize = 1024);
#ifdef EXV_UNICODE_PATH
/*!
@brief Like HttpIo(const std::string& url, size_t blockSize = 1024) but accepts a
unicode url in an std::wstring.
@note This constructor is only available on Windows.
*/
HttpIo(const std::wstring& wurl, size_t blockSize = 1024);
#endif
//@}
protected:
// NOT IMPLEMENTED
//! Copy constructor
HttpIo(HttpIo& rhs);
//! Assignment operator
HttpIo& operator=(const HttpIo& rhs);
// Pimpl idiom
class HttpImpl;
//! @name Creators
//@{
//! Default Destructor
virtual ~HttpIo(){}
//@}
};
#if EXV_USE_CURL == 1
/*!
@brief Provides the http, https read/write access and ftp read access for the RemoteIo.
This class is based on libcurl.
*/
class EXIV2API CurlIo : public RemoteIo {
public:
//! @name Creators
//@{
/*!
@brief Constructor that accepts the URL on which IO will be
performed.
@param url The full path of url
@param blockSize the size of the memory block. The file content is
divided into the memory blocks. These blocks are populated
on demand from the server, so it avoids copying the complete file.
@throw Error if it is unable to init curl pointer.
*/
CurlIo(const std::string& url, size_t blockSize = 0);
#ifdef EXV_UNICODE_PATH
/*!
@brief Like CurlIo(const std::string& url, size_t blockSize = 0) but accepts a
unicode url in an std::wstring.
@note This constructor is only available on Windows.
*/
CurlIo(const std::wstring& wurl, size_t blockSize = 0);
#endif
/*!
@brief Write access is only available for some protocols. This method
will call RemoteIo::write(const byte* data, long wcount) if the write
access is available for the protocol. Otherwise, it throws the Error.
*/
long write(const byte* data, long wcount);
/*!
@brief Write access is only available for some protocols. This method
will call RemoteIo::write(BasicIo& src) if the write access is available
for the protocol. Otherwise, it throws the Error.
*/
long write(BasicIo& src);
protected:
// NOT IMPLEMENTED
//! Copy constructor
CurlIo(CurlIo& rhs);
//! Assignment operator
CurlIo& operator=(const CurlIo& rhs);
// Pimpl idiom
class CurlImpl;
//! @name Creators
//@{
//! Default Destructor
virtual ~CurlIo(){}
//@}
};
#endif
#if EXV_USE_SSH == 1
/*!
@brief Provides the ssh read/write access and sftp read access for the RemoteIo.
This class is based on libssh.
*/
class EXIV2API SshIo : public RemoteIo {
public:
//! @name Creators
//@{
/*!
@brief Constructor that accepts the URL on which IO will be
performed.
@param url The full path of url
@param blockSize the size of the memory block. The file content is
divided into the memory blocks. These blocks are populated
on demand from the server, so it avoids copying the complete file.
@throw Error if it is unable to init ssh session.
*/
SshIo(const std::string& url, size_t blockSize = 1024);
#ifdef EXV_UNICODE_PATH
/*!
@brief Like SshIo(const std::string& url, size_t blockSize = 1024) but accepts a
unicode url in an std::wstring.
@note This constructor is only available on Windows.
*/
SshIo(const std::wstring& wurl, size_t blockSize = 1024);
#endif
//@}
protected:
// NOT IMPLEMENTED
//! Copy constructor
SshIo(SshIo& rhs);
//! Assignment operator
SshIo& operator=(const SshIo& rhs);
// Pimpl idiom
class SshImpl;
//! @name Creators
//@{
//! Default Destructor
virtual ~SshIo(){}
//@}
};
#endif
// *****************************************************************************
// template, inline and free functions
@@ -736,8 +1270,27 @@ namespace Exiv2 {
@note This function is only available on Windows.
*/
EXIV2API long writeFile(const DataBuf& buf, const std::wstring& wpath);
#endif
/*!
@brief replace each substring of the subject that matches the given search string with the given replacement.
@return the subject after replacing.
*/
EXIV2API std::string ReplaceStringInPlace(std::string subject, const std::string& search,
const std::string& replace);
#ifdef EXV_UNICODE_PATH
/*!
@brief Like ReplaceStringInPlace() but accepts a unicode path in an std::wstring.
@return the subject after replacing.
@note This function is only available on Windows.
*/
EXIV2API std::wstring ReplaceStringInPlace(std::wstring subject, const std::wstring& search,
const std::wstring& replace);
#endif
#if EXV_USE_CURL == 1
/*!
@brief The callback function is called by libcurl to write the data
*/
EXIV2API size_t curlWriter(char* data, size_t size, size_t nmemb, std::string* writerData);
#endif
} // namespace Exiv2
#endif // #ifndef BASICIO_HPP_
@@ -21,7 +21,7 @@
/*!
@file bmpimage.hpp
@brief Windows Bitmap (BMP) image
@version $Rev$
@version $Rev: 3091 $
@author Marco Piovanelli, Ovolab (marco)
<a href="mailto:marco.piovanelli@pobox.com">marco.piovanelli@pobox.com</a>
@date 05-Mar-2007, marco: created
+12
View File
@@ -0,0 +1,12 @@
#ifdef _MSC_VER
# include "exv_msvc.h"
#else
# include "exv_conf.h"
#endif
// Linux GCC 4.8 appears to be confused about strerror_r
#ifndef EXV_STRERROR_R_CHAR_P
#ifdef __gnu_linux__
#define EXV_STRERROR_R_CHAR_P
#endif
#endif
@@ -21,7 +21,7 @@
/*!
@file convert.hpp
@brief Exif and IPTC conversions to and from XMP
@version $Rev$
@version $Rev: 3091 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a><BR>
Vladimir Nadvornik (vn)
@@ -32,13 +32,8 @@
#ifndef CONVERT_HPP_
#define CONVERT_HPP_
// *****************************************************************************
// included header files
#ifdef _MSC_VER
# include "exv_msvc.h"
#else
# include "exv_conf.h"
#endif
#include "config.h"
// + standard includes
#include <string>
@@ -21,7 +21,7 @@
/*!
@file cr2image.hpp
@brief Class Cr2Image
@version $Rev$
@version $Rev: 3091 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@date 22-Apr-06, ahu: created
@@ -23,7 +23,7 @@
@brief Class CrwImage to access Canon CRW images.<BR>
References:<BR>
<a href="http://www.sno.phy.queensu.ca/~phil/exiftool/canon_raw.html">The Canon RAW (CRW) File Format</a> by Phil Harvey
@version $Rev$
@version $Rev: 3091 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@date 28-Aug-05, ahu: created
@@ -21,7 +21,7 @@
/*!
@file datasets.hpp
@brief IPTC dataset and type information
@version $Rev$
@version $Rev: 3091 $
@author Brad Schick (brad) <brad@robotbattle.com>
@date 24-Jul-04, brad: created
*/
@@ -21,7 +21,7 @@
/*!
@file easyaccess.hpp
@brief Provides easy (high-level) access to some Exif meta data.
@version $Rev$
@version $Rev: 3091 $
@author Carsten Pfeiffer <pfeiffer@kde.org>
@date 28-Feb-09, gis: created
*/
+1 -1
View File
@@ -21,7 +21,7 @@
/*!
@file error.hpp
@brief Error class for exceptions, log message class
@version $Rev$
@version $Rev: 3091 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@date 15-Jan-04, ahu: created<BR>
+1 -1
View File
@@ -21,7 +21,7 @@
/*!
@file exif.hpp
@brief Encoding and decoding of Exif data
@version $Rev$
@version $Rev: 3091 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@date 09-Jan-04, ahu: created
+2 -1
View File
@@ -21,7 +21,7 @@
/*!
@file exiv2.hpp
@brief Include all Exiv2 header files.
@version $Rev$
@version $Rev: 3091 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@date 21-Jun-10, ahu: created
@@ -45,6 +45,7 @@
#include "gifimage.hpp"
#include "image.hpp"
#include "iptc.hpp"
#include "http.hpp"
#include "jp2image.hpp"
#include "jpgimage.hpp"
#include "metadatum.hpp"
@@ -21,7 +21,7 @@
/*!
@file exiv2app.hpp
@brief Defines class Params, used for the command line handling of exiv2
@version $Rev$
@version $Rev: 3091 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@date 08-Dec-03, ahu: created
+162
View File
@@ -0,0 +1,162 @@
/* ***************************************************************** -*- C -*- */
/*!
@file exv_msvc.h
@brief Configuration settings for MSVC
@version $Rev: 2320 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@date 07-Feb-04, ahu: created
26-Feb-05, ahu: renamed and moved to src directory
*/
#ifdef _MSC_VER
#ifndef _EXV_MSVC_H_
#define _EXV_MSVC_H_
#if _MSC_VER >= 1600
// stdint.h was introduced with DevStudio 2010
#define EXV_HAVE_STDINT_H 1
#endif
#if _MSC_VER >= 1700
#define MSDEV_2012 1
#elif _MSC_VER >= 1600
#define MSDEV_2010 1
#elif _MSC_VER >= 1500
#define MSDEV_2008 1
#elif _MSC_VER >= 1400
#define MSDEV_2005 1
#else
#define MSDEV_2003 1
#endif
#if MSDEV_2012
#define HAVE_NTOHLL 1
#endif
/* Define to 1 if you have the <process.h> header file. */
#define EXV_HAVE_PROCESS_H 1
/* Define to the address where bug reports for this package should be sent. */
#define EXV_PACKAGE_BUGREPORT "ahuggel@gmx.net"
/* Define to the full name of this package. */
#define EXV_PACKAGE_NAME "exiv2"
/* Define to the full name and version of this package. */
#define EXV_PACKAGE_STRING "exiv2 0.24"
/* Define to the one symbol short name of this package. */
#define EXV_PACKAGE_TARNAME "exiv2"
/* Define to the version of this package. */
#define EXV_PACKAGE_VERSION "0.24"
/* Define to `int' if <sys/types.h> does not define pid_t. */
typedef int pid_t;
#ifndef EXV_COMMERCIAL_VERSION
/* Define to 1 to enable translation of Nikon lens names. */
# define EXV_HAVE_LENSDATA 1
/* Define to 1 if translation of program messages to the user's
native language is requested. */
# undef EXV_ENABLE_NLS
#endif /* !EXV_COMMERCIAL_VERSION */
/* Define to 1 if you have the `iconv' function. */
# undef EXV_HAVE_ICONV
#ifdef EXV_HAVE_ICONV
#define EXV_ICONV_CONST const
#endif
/* Define as 1 if you have the `zlib' library. (0 to omit zlib) [png support] */
#define HAVE_LIBZ 1
#if HAVE_LIBZ
#define EXV_HAVE_LIBZ
// assist VC7.1 to compile vsnprintf
#if (_MSC_VER < 1400) && !defined(vsnprintf)
#define vsnprintf _vsnprintf
#endif
#endif
/* Define to 1 if you have the Adobe XMP Toolkit. */
#define EXV_HAVE_XMP_TOOLKIT 1
/* Define as 1 if you want to use curl to perform http I/O */
#ifndef EXV_USE_CURL
#define EXV_USE_CURL 1
#endif
/* Define as 1 if you want to use libssh (for ssh:// and sftp:// support */
#ifndef EXV_USE_SSH
#define EXV_USE_SSH 1
#endif
/* Help out our buddy curl */
#ifndef EXV_HAVE_DLL
#define CURL_STATICLIB
#endif
#pragma comment(lib, "ws2_32.lib")
#pragma comment(lib, "wldap32.lib")
/* File path seperator */
#define EXV_SEPERATOR_STR "\\"
#define EXV_SEPERATOR_CHR '\\'
/* Windows unicode path support */
// #define EXV_UNICODE_PATH
/* Define to 1 if you have the `mmap' function. */
/* #undef EXV_HAVE_MMAP */
/* Define to 1 if you have the `munmap' function. */
/* #undef EXV_HAVE_MUNMAP */
/* Shared library support */
#ifdef EXV_HAVE_DLL
#define EXV_IMPORT __declspec(dllimport)
#define EXV_EXPORT __declspec(dllexport)
#define EXV_DLLLOCAL
#define EXV_DLLPUBLIC
#else
#define EXV_IMPORT
#define EXV_EXPORT
#define EXV_DLLLOCAL
#define EXV_DLLPUBLIC
#define EXIV2API
#endif
/* Define EXIV2API for DLL builds */
#ifdef EXV_HAVE_DLL
# ifdef EXV_BUILDING_LIB
# define EXIV2API EXV_EXPORT
# else
# define EXIV2API EXV_IMPORT
# endif /* ! EXV_BUILDING_LIB */
#else
# define EXIV2API
#endif /* ! EXV_HAVE_DLL */
/*
Disable warning 4251. This is warning from std templates about exporting interfaces
*/
#ifdef EXV_HAVE_DLL
#pragma warning( disable : 4251 )
#endif
/*
Visual Studio C++ 2005 (8.0)
Disable warnings about 'deprecated' standard functions
See, eg. http://www.informit.com/guides/content.asp?g=cplusplus&seqNum=259
*/
#if _MSC_VER >= 1400
# pragma warning(disable : 4996)
#endif
#endif /* _EXV_MSVC_H_ */
#endif /* _MSC_VER */
+162
View File
@@ -0,0 +1,162 @@
/* ***************************************************************** -*- C -*- */
/*!
@file exv_msvc.h
@brief Configuration settings for MSVC
@version $Rev: 2320 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@date 07-Feb-04, ahu: created
26-Feb-05, ahu: renamed and moved to src directory
*/
#ifdef _MSC_VER
#ifndef _EXV_MSVC_H_
#define _EXV_MSVC_H_
#if _MSC_VER >= 1600
// stdint.h was introduced with DevStudio 2010
#define EXV_HAVE_STDINT_H 1
#endif
#if _MSC_VER >= 1700
#define MSDEV_2012 1
#elif _MSC_VER >= 1600
#define MSDEV_2010 1
#elif _MSC_VER >= 1500
#define MSDEV_2008 1
#elif _MSC_VER >= 1400
#define MSDEV_2005 1
#else
#define MSDEV_2003 1
#endif
#if MSDEV_2012
#define HAVE_NTOHLL 1
#endif
/* Define to 1 if you have the <process.h> header file. */
#define EXV_HAVE_PROCESS_H 1
/* Define to the address where bug reports for this package should be sent. */
#define EXV_PACKAGE_BUGREPORT "ahuggel@gmx.net"
/* Define to the full name of this package. */
#define EXV_PACKAGE_NAME "exiv2"
/* Define to the full name and version of this package. */
#define EXV_PACKAGE_STRING "exiv2 0.24"
/* Define to the one symbol short name of this package. */
#define EXV_PACKAGE_TARNAME "exiv2"
/* Define to the version of this package. */
#define EXV_PACKAGE_VERSION "0.24"
/* Define to `int' if <sys/types.h> does not define pid_t. */
typedef int pid_t;
#ifndef EXV_COMMERCIAL_VERSION
/* Define to 1 to enable translation of Nikon lens names. */
# define EXV_HAVE_LENSDATA 1
/* Define to 1 if translation of program messages to the user's
native language is requested. */
# undef EXV_ENABLE_NLS
#endif /* !EXV_COMMERCIAL_VERSION */
/* Define to 1 if you have the `iconv' function. */
# undef EXV_HAVE_ICONV
#ifdef EXV_HAVE_ICONV
#define EXV_ICONV_CONST const
#endif
/* Define as 1 if you have the `zlib' library. (0 to omit zlib) [png support] */
#define HAVE_LIBZ 1
#if HAVE_LIBZ
#define EXV_HAVE_LIBZ
// assist VC7.1 to compile vsnprintf
#if (_MSC_VER < 1400) && !defined(vsnprintf)
#define vsnprintf _vsnprintf
#endif
#endif
/* Define to 1 if you have the Adobe XMP Toolkit. */
#define EXV_HAVE_XMP_TOOLKIT 1
/* Define as 1 if you want to use curl to perform http I/O */
#ifndef EXV_USE_CURL
#define EXV_USE_CURL 0
#endif
/* Define as 1 if you want to use libssh (for ssh:// and sftp:// support */
#ifndef EXV_USE_SSH
#define EXV_USE_SSH 0
#endif
/* Help out our buddy curl */
#ifndef EXV_HAVE_DLL
#define CURL_STATICLIB
#endif
#pragma comment(lib, "ws2_32.lib")
#pragma comment(lib, "wldap32.lib")
/* File path seperator */
#define EXV_SEPERATOR_STR "\\"
#define EXV_SEPERATOR_CHR '\\'
/* Windows unicode path support */
// #define EXV_UNICODE_PATH
/* Define to 1 if you have the `mmap' function. */
/* #undef EXV_HAVE_MMAP */
/* Define to 1 if you have the `munmap' function. */
/* #undef EXV_HAVE_MUNMAP */
/* Shared library support */
#ifdef EXV_HAVE_DLL
#define EXV_IMPORT __declspec(dllimport)
#define EXV_EXPORT __declspec(dllexport)
#define EXV_DLLLOCAL
#define EXV_DLLPUBLIC
#else
#define EXV_IMPORT
#define EXV_EXPORT
#define EXV_DLLLOCAL
#define EXV_DLLPUBLIC
#define EXIV2API
#endif
/* Define EXIV2API for DLL builds */
#ifdef EXV_HAVE_DLL
# ifdef EXV_BUILDING_LIB
# define EXIV2API EXV_EXPORT
# else
# define EXIV2API EXV_IMPORT
# endif /* ! EXV_BUILDING_LIB */
#else
# define EXIV2API
#endif /* ! EXV_HAVE_DLL */
/*
Disable warning 4251. This is warning from std templates about exporting interfaces
*/
#ifdef EXV_HAVE_DLL
#pragma warning( disable : 4251 )
#endif
/*
Visual Studio C++ 2005 (8.0)
Disable warnings about 'deprecated' standard functions
See, eg. http://www.informit.com/guides/content.asp?g=cplusplus&seqNum=259
*/
#if _MSC_VER >= 1400
# pragma warning(disable : 4996)
#endif
#endif /* _EXV_MSVC_H_ */
#endif /* _MSC_VER */
+214
View File
@@ -0,0 +1,214 @@
// ********************************************************* -*- C++ -*-
/*
* Copyright (C) 2004-2013 Andreas Huggel <ahuggel@gmx.net>
*
* This program is part of the Exiv2 distribution.
*
* 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 Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
*/
/*!
@file futils.hpp
@brief Basic file utility functions required by Exiv2
@version $Rev: 3091 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@date 12-Dec-03, ahu: created<BR>
02-Apr-05, ahu: moved to Exiv2 namespace
*/
#ifndef FUTILS_HPP_
#define FUTILS_HPP_
// *********************************************************************
// included header files
#include "config.h"
#define UNUSED(x) (void)(x)
#ifdef EXV_HAVE_STDINT_H
# include <stdint.h> // for uint8_t
#endif
// + standard includes
#include <types.hpp>
#include <string>
#include <map>
#include <limits.h> // for UINT_MAX
// *********************************************************************
// namespace extensions
namespace Exiv2 {
//! the name of environmental variables.
enum EnVar { envHTTPPOST = 0, envTIMEOUT = 1};
//! the collection of protocols.
enum Protocol { pFile = 0, pHttp, pFtp, pHttps, pSftp, pSsh, pFileUri, pDataUri, pStdin};
//! the dictionary type for the protcol identifer strings.
typedef std::map<std::string,Protocol> protDict_t;
//! the dictionary iterator for protcol identifer strings.
typedef std::map<std::string,Protocol>::iterator protDict_i;
#ifdef EXV_UNICODE_PATH
//! the dictionary type for the protcol identifer strings.
typedef std::map<std::wstring,Protocol> wprotDict_t;
//! the dictionary iterator for protcol identifer strings.
typedef std::map<std::wstring,Protocol>::iterator wprotDict_i;
#endif
// *********************************************************************
// free functions
/*!
@brief Return the value of environmental variable.
@param var The name of environmental variable.
@return the value of environmental variable. If it's empty, the default value is returned.
*/
EXIV2API std::string getEnv(EnVar var);
/*!
@brief Convert an integer value to its hex character.
@param code The integer value.
@return the input's hex character.
*/
EXIV2API char to_hex(char code);
/*!
@brief Convert a hex character to its integer value.
@param ch The hex character.
@return the input's integer value.
*/
EXIV2API char from_hex(char ch);
/*!
@brief Encode the input url.
@param str The url needs encoding.
@return the url-encoded version of str.
@note Be sure to free() the returned string after use
Source: http://www.geekhideout.com/urlcode.shtml
*/
EXIV2API char* urlencode(char* str);
/*!
@brief Decode the input url.
@param str The url needs decoding.
@return the url-decoded version of str.
@note Be sure to free() the returned string after use
Source: http://www.geekhideout.com/urlcode.shtml
*/
EXIV2API char* urldecode(const char* str);
/*!
@brief Like urlencode(char* str) but accept the input url in the std::string and modify it.
*/
EXIV2API void urldecode(std::string& str);
/*!
@brief Encode in base64 the data in data_buf and put the resulting string in result.
@param data_buf The data need to encode
@param dataLength Size in bytes of the in buffer
@param result The container for the result, NULL if it fails
@param resultSize Size in bytes of the out string, it should be at least ((dataLength + 2) / 3) * 4 + 1
@return 1 indicate success
@note Source: http://en.wikibooks.org/wiki/Algorithm_Implementation/Miscellaneous/Base64
*/
EXIV2API int base64encode(const void* data_buf, size_t dataLength, char* result, size_t resultSize);
/*!
@brief Decode base64 data and put the resulting string in out.
@param in The data need to decode.
@param out The container for the result, it should be large enough to contain the result.
@param out_size The size of out in bytes.
@return the size of the resulting string. If it fails, return -1.
@note Source: https://github.com/davidgaleano/libwebsockets/blob/master/lib/base64-decode.c
*/
EXIV2API long base64decode(const char *in, char *out, size_t out_size);
/*!
@brief Return the protocol of the path.
@param path The path of file to extract the protocol.
@return the protocol of the path.
*/
EXIV2API Protocol fileProtocol(const std::string& path);
#ifdef EXV_UNICODE_PATH
/*!
@brief Like fileProtocol() but accept a unicode path in an std::wstring.
@note This function is only available on Windows.
*/
EXIV2API Protocol fileProtocol(const std::wstring& wpath);
#endif
/*!
@brief Test if a file exists.
@param path Name of file to verify.
@param ct Flag to check if <i>path</i> is a regular file.
@return true if <i>path</i> exists and, if <i>ct</i> is set,
is a regular file, else false.
@note The function calls <b>stat()</b> test for <i>path</i>
and its type, see stat(2). <b>errno</b> is left unchanged
in case of an error.
*/
EXIV2API bool fileExists(const std::string& path, bool ct =false);
#ifdef EXV_UNICODE_PATH
/*!
@brief Like fileExists(const std::string& path, bool ct =false) but
accepts a unicode path in an std::wstring.
@note This function is only available on Windows.
*/
EXIV2API bool fileExists(const std::wstring& wpath, bool ct =false);
#endif
/*!
@brief Get the path of file URL.
@param url The file URL in the format file:///<path> or file://<host>/<path>.
@return the path of file URL.
*/
EXIV2API std::string pathOfFileUrl(const std::string& url);
#ifdef EXV_UNICODE_PATH
/*!
@brief Like pathOfFileUrl(const std::string& url) but accepts a unicode path in an std::wstring.
@note This function is only available on Windows.
*/
EXIV2API std::wstring pathOfFileUrl(const std::wstring& wurl);
#endif
/*!
@brief Return a system error message and the error code (errno).
See %strerror(3).
*/
EXIV2API std::string strError();
/*!
@brief A container for URL components. It also provides the method to parse a
URL to get the protocol, host, path, port, querystring, username, password.
Source: http://stackoverflow.com/questions/2616011/easy-way-to-parse-a-url-in-c-cross-platform
*/
class Uri
{
public:
// DATA
std::string QueryString; //!< URL query string
std::string Path; //!< URL file path
std::string Protocol; //!< URL protocol
std::string Host; //!< URL host
std::string Port; //!< URL port
std::string Username; //!< URL username
std::string Password; //!< URL password
/*!
@brief Parse the input URL to the protocol, host, path, username, password
*/
static Uri EXIV2API Parse(const std::string &uri);
/*!
@brief Decode the url components.
*/
static void EXIV2API Decode(Uri& uri);
}; // class Uri
} // namespace Exiv2
#endif // #ifndef FUTILS_HPP_
+84
View File
@@ -0,0 +1,84 @@
/*
* Copyright (c) 1987, 1993, 1994, 1996
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef __GETOPT_H__
#define __GETOPT_H__
#ifdef __cplusplus
extern "C" {
#endif
extern int opterr; /* if error message should be printed */
extern int optind; /* index into parent argv vector */
extern int optopt; /* character checked for validity */
extern int optreset; /* reset getopt */
extern char *optarg; /* argument associated with option */
int getopt (int, char * const *, const char *);
#ifdef __cplusplus
}
#endif
#endif /* __GETOPT_H__ */
#ifndef __UNISTD_GETOPT__
#ifndef __GETOPT_LONG_H__
#define __GETOPT_LONG_H__
#ifdef __cplusplus
extern "C" {
#endif
struct option {
const char *name;
int has_arg;
int *flag;
int val;
};
int getopt_long (int, char *const *, const char *, const struct option *, int *);
#ifndef HAVE_DECL_GETOPT
#define HAVE_DECL_GETOPT 1
#endif
#define no_argument 0
#define required_argument 1
#define optional_argument 2
#ifdef __cplusplus
}
#endif
#endif /* __GETOPT_LONG_H__ */
#endif /* __UNISTD_GETOPT__ */
@@ -22,7 +22,7 @@
@file gifimage.hpp
@brief GIF image, implemented using the following references:
<a href="http://www.w3.org/Graphics/GIF/spec-gif89a.txt">GIF89 specification</a> by W3C<br>
@version $Rev$
@version $Rev: 3091 $
@author Marco Piovanelli, Ovolab (marco)
<a href="mailto:marco.piovanelli@pobox.com">marco.piovanelli@pobox.com</a>
@date 26-Feb-2007, marco: created
+19
View File
@@ -0,0 +1,19 @@
#ifndef HTTP_H_
#define HTTP_H_
#include <string>
#include <map>
#include <algorithm>
#include <exiv2/exiv2.hpp>
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);
}
#endif
+50
View File
@@ -0,0 +1,50 @@
/* **************************************************************** -*- C -*- */
/*
* Copyright (C) 2004-2012 Andreas Huggel <ahuggel@gmx.net>
*
* This program is part of the Exiv2 distribution.
*
* 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 Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
*/
/*
File: i18n.h
Brief: i18n definitions. Do not use. This is an Exiv2 internal header.
Version: $Rev: 2681 $
Author(s): Gilles Caulier (gc) <caulier.gilles@kdemail.net>
History: 01-Nov-06, gc: created
*/
#ifndef I18N_H_
#define I18N_H_
#include "config.h"
/* NLS can be disabled through the configure --disable-nls option. */
#ifdef EXV_ENABLE_NLS
# include <libintl.h>
// Definition is in types.cpp
EXIV2API const char* _exvGettext(const char* str);
# define _(String) _exvGettext(String)
# define N_(String) String
#else /* NLS is disabled */
# define _(String) (String)
# define N_(String) String
#endif /* EXV_ENABLE_NLS */
#endif /* I18N_H_ */
+33 -3
View File
@@ -21,7 +21,7 @@
/*!
@file image.hpp
@brief Class Image, defining the interface for all Image subclasses.
@version $Rev$
@version $Rev: 3091 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@author Brad Schick (brad)
@@ -102,6 +102,12 @@ namespace Exiv2 {
//! @name Manipulators
//@{
/*!
@brief Print out the structure of image file.
@throw Error if reading of the file fails or the image data is
not valid (does not look like data of the specific image type).
*/
virtual void printStructure();
/*!
@brief Read all metadata supported by a specific image format from the
image. Before this method is called, the image metadata will be
@@ -444,24 +450,48 @@ namespace Exiv2 {
class EXIV2API ImageFactory {
friend bool Image::good() const;
public:
/*!
@brief Create the appropriate class type implemented BasicIo based on the protocol of the input.
"-" path implies the data from stdin and it is handled by StdinIo.
Http path can be handled by either HttpIo or CurlIo. Https, ftp paths
are handled by CurlIo. Ssh, sftp paths are handled by SshIo. Others are handled by FileIo.
@param path %Image file.
@param useCurl Indicate whether the libcurl is used or not.
If it's true, http is handled by CurlIo. Otherwise it is handled by HttpIo.
@return An auto-pointer that owns an BasicIo instance.
@throw Error If the file is not found or it is unable to connect to the server to
read the remote file.
*/
static BasicIo::AutoPtr createIo(const std::string& path, bool useCurl = true);
#ifdef EXV_UNICODE_PATH
/*!
@brief Like createIo() but accepts a unicode path in an std::wstring.
@note This function is only available on Windows.
*/
static BasicIo::AutoPtr createIo(const std::wstring& wpath, bool useCurl = true);
#endif
/*!
@brief Create an Image subclass of the appropriate type by reading
the specified file. %Image type is derived from the file
contents.
@param path %Image file. The contents of the file are tested to
determine the image type. File extension is ignored.
@param useCurl Indicate whether the libcurl is used or not.
If it's true, http is handled by CurlIo. Otherwise it is handled by HttpIo.
@return An auto-pointer that owns an Image instance whose type
matches that of the file.
@throw Error If opening the file fails or it contains data of an
unknown image type.
*/
static Image::AutoPtr open(const std::string& path);
static Image::AutoPtr open(const std::string& path, bool useCurl = true);
#ifdef EXV_UNICODE_PATH
/*!
@brief Like open() but accepts a unicode path in an std::wstring.
@note This function is only available on Windows.
*/
static Image::AutoPtr open(const std::wstring& wpath);
static Image::AutoPtr open(const std::wstring& wpath, bool useCurl = true);
#endif
/*!
@brief Create an Image subclass of the appropriate type by reading
+1 -1
View File
@@ -21,7 +21,7 @@
/*!
@file iptc.hpp
@brief Encoding and decoding of IPTC data
@version $Rev$
@version $Rev: 3091 $
@author Brad Schick (brad)
<a href="mailto:brad@robotbattle.com">brad@robotbattle.com</a>
@date 31-Jul-04, brad: created
@@ -22,7 +22,7 @@
@file jp2image.hpp
@brief JPEG-2000 image, implemented using the following references:
<a href="http://jpeg.org/public/fcd15444-6.pdf">ISO/IEC JTC 1/SC 29/WG1 N2401: JPEG 2000 Part 6 FCD 15444-6</a><br>
@version $Rev$
@version $Rev: 3091 $
@author Gilles Caulier (cgilles)
<a href="mailto:caulier dot gilles at gmail dot com">caulier dot gilles at gmail dot com</a>
@author Marco Piovanelli, Ovolab (marco)
@@ -21,7 +21,7 @@
/*!
@file jpgimage.hpp
@brief Class JpegImage to access JPEG images
@version $Rev$
@version $Rev: 3091 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@author Brad Schick (brad)
@@ -150,6 +150,7 @@ namespace Exiv2 {
public:
//! @name Manipulators
//@{
void printStructure();
void readMetadata();
void writeMetadata();
//@}
@@ -218,6 +219,9 @@ namespace Exiv2 {
//@}
// Constant Data
static const byte dht_; //!< JPEG DHT marker
static const byte dqt_; //!< JPEG DQT marker
static const byte dri_; //!< JPEG DRI marker
static const byte sos_; //!< JPEG SOS marker
static const byte eoi_; //!< JPEG EOI marker
static const byte app0_; //!< JPEG APP0 marker
@@ -21,7 +21,7 @@
/*!
@file metadatum.hpp
@brief Provides abstract base classes Metadatum and Key
@version $Rev$
@version $Rev: 3091 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@author Brad Schick (brad)
@@ -22,7 +22,7 @@
@file mrwimage.hpp
@brief Minolta RAW image, implemented using the following references:
<a href="http://www.dalibor.cz/minolta/raw_file_format.htm">Minolta Raw file format</a> by Dalibor Jelinek
@version $Rev$
@version $Rev: 3091 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@date 13-May-06, ahu: created
@@ -21,7 +21,7 @@
/*!
@file orfimage.hpp
@brief Olympus RAW image
@version $Rev$
@version $Rev: 3091 $
@author Jeff Costlow
<a href="mailto:costlow@gmail.com">costlow@gmail.com</a>
@date 31-Jul-07, costlow: created
@@ -22,7 +22,7 @@
@file pgfimage.hpp
@brief PGF image, implemented using the following references:
<a href="http://www.libpgf.org/uploads/media/PGF_stamm_wscg02.pdf">PGF specification</a> from libpgf web site<br>
@version $Rev$
@version $Rev: 3091 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@author Gilles Caulier (cgilles)
@@ -23,7 +23,7 @@
@brief PNG image, implemented using the following references:
<a href="http://www.w3.org/TR/PNG/">PNG specification</a> by W3C<br>
<a href="http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/PNG.html">PNG tags list</a> by Phil Harvey<br>
@version $Rev$
@version $Rev: 3091 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@author Gilles Caulier (cgilles)
@@ -84,6 +84,7 @@ namespace Exiv2
//! @name Manipulators
//@{
void printStructure();
void readMetadata();
void writeMetadata();
//@}
@@ -21,7 +21,7 @@
/*!
@file preview.hpp
@brief Classes to access all preview images embedded in an image.
@version $Rev$
@version $Rev: 3091 $
@author Vladimir Nadvornik (vn)
<a href="mailto:nadvornik@suse.cz">nadvornik@suse.cz</a>
@date 18-Sep-08, vn: created
+210
View File
@@ -0,0 +1,210 @@
/*!
@file private.h
@brief This file is from the tz distribution at ftp://elsie.nci.nih.gov/pub/
@version $Rev: 1358 $
*/
#ifndef PRIVATE_H
#define PRIVATE_H
/*
** This file is in the public domain, so clarified as of
** 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov).
*/
/*
** This header is for use ONLY with the time conversion code.
** There is no guarantee that it will remain unchanged,
** or that it will remain at all.
** Do NOT copy it to any system include directory.
** Thank you!
*/
/*
** ID
*/
#ifndef lint
#ifndef NOID
static char privatehid[] = "@(#)private.h 7.53";
#endif /* !defined NOID */
#endif /* !defined lint */
/* ahu: moved required preprocessor symbols to config.h */
/* ahu: disable warnings */
#ifdef _MSC_VER
// disable warning 'uses old-style declarator' C4131
#pragma warning (disable: 4131)
#endif
/*
** Nested includes
*/
#include "sys/types.h" /* for time_t */
#include "stdio.h"
#include "errno.h"
#include "string.h"
#include "limits.h" /* for CHAR_BIT */
#include "time.h"
#include "stdlib.h"
/* ahu: added io.h for MSVC */
#ifdef _MSC_VER
# include "io.h"
#endif
/* ahu: deleted include libintl.h */
/* ahu: deleted include sys/wait.h and WIFEXITED, WEXITSTATUS macros */
#if EXV_HAVE_UNISTD_H - 0
#include "unistd.h" /* for F_OK and R_OK */
#endif /* EXV_HAVE_UNISTD_H - 0 */
#if !(EXV_HAVE_UNISTD_H - 0)
#ifndef F_OK
#define F_OK 0
#endif /* !defined F_OK */
#ifndef R_OK
#define R_OK 4
#endif /* !defined R_OK */
#endif /* !(EXV_HAVE_UNISTD_H - 0) */
/* Unlike <ctype.h>'s isdigit, this also works if c < 0 | c > UCHAR_MAX. */
#define is_digit(c) ((unsigned)(c) - '0' <= 9)
/*
** Workarounds for compilers/systems.
*/
/*
** SunOS 4.1.1 cc lacks prototypes.
*/
#ifndef P
#ifdef __STDC__
#define P(x) x
#endif /* defined __STDC__ */
#ifndef __STDC__
#define P(x) ()
#endif /* !defined __STDC__ */
#endif /* !defined P */
/*
** SunOS 4.1.1 headers lack EXIT_SUCCESS.
*/
#ifndef EXIT_SUCCESS
#define EXIT_SUCCESS 0
#endif /* !defined EXIT_SUCCESS */
/*
** SunOS 4.1.1 headers lack EXIT_FAILURE.
*/
#ifndef EXIT_FAILURE
#define EXIT_FAILURE 1
#endif /* !defined EXIT_FAILURE */
/*
** SunOS 4.1.1 headers lack FILENAME_MAX.
*/
#ifndef FILENAME_MAX
#ifndef MAXPATHLEN
#ifdef unix
#include "sys/param.h"
#endif /* defined unix */
#endif /* !defined MAXPATHLEN */
#ifdef MAXPATHLEN
#define FILENAME_MAX MAXPATHLEN
#endif /* defined MAXPATHLEN */
#ifndef MAXPATHLEN
#define FILENAME_MAX 1024 /* Pure guesswork */
#endif /* !defined MAXPATHLEN */
#endif /* !defined FILENAME_MAX */
/* ahu: deleted unlink declaration and remove define */
/* ahu: deleted errno declaration */
/* ahu: deleted private function declarations */
/*
** Finally, some convenience items.
*/
#ifndef TRUE
#define TRUE 1
#endif /* !defined TRUE */
#ifndef FALSE
#define FALSE 0
#endif /* !defined FALSE */
#ifndef TYPE_BIT
#define TYPE_BIT(type) (sizeof (type) * CHAR_BIT)
#endif /* !defined TYPE_BIT */
#ifndef TYPE_SIGNED
#define TYPE_SIGNED(type) (((type) -1) < 0)
#endif /* !defined TYPE_SIGNED */
#ifndef INT_STRLEN_MAXIMUM
/*
** 302 / 1000 is log10(2.0) rounded up.
** Subtract one for the sign bit if the type is signed;
** add one for integer division truncation;
** add one more for a minus sign if the type is signed.
*/
#define INT_STRLEN_MAXIMUM(type) \
((TYPE_BIT(type) - TYPE_SIGNED(type)) * 302 / 1000 + 1 + TYPE_SIGNED(type))
#endif /* !defined INT_STRLEN_MAXIMUM */
/*
** INITIALIZE(x)
*/
#ifndef GNUC_or_lint
#ifdef lint
#define GNUC_or_lint
#endif /* defined lint */
#ifndef lint
#ifdef __GNUC__
#define GNUC_or_lint
#endif /* defined __GNUC__ */
#endif /* !defined lint */
#endif /* !defined GNUC_or_lint */
#ifndef INITIALIZE
#ifdef GNUC_or_lint
#define INITIALIZE(x) ((x) = 0)
#endif /* defined GNUC_or_lint */
#ifndef GNUC_or_lint
#define INITIALIZE(x)
#endif /* !defined GNUC_or_lint */
#endif /* !defined INITIALIZE */
/* ahu: deleted definition of _(msgid) macro */
#ifndef TZ_DOMAIN
#define TZ_DOMAIN "tz"
#endif /* !defined TZ_DOMAIN */
#if HAVE_INCOMPATIBLE_CTIME_R
#undef asctime_r
#undef ctime_r
char *asctime_r P((struct tm const *, char *));
char *ctime_r P((time_t const *, char *));
#endif /* HAVE_INCOMPATIBLE_CTIME_R */
/*
** UNIX was a registered trademark of The Open Group in 2003.
*/
#endif /* !defined PRIVATE_H */
@@ -23,7 +23,7 @@
@brief XMP property and type information.<BR>References:<BR>
<a href="http://www.adobe.com/devnet/xmp/pdfs/xmp_specification.pdf">XMP Specification</a> from Adobe
<I>(Property descriptions copied from the XMP specification with the permission of Adobe)</I>
@version $Rev$
@version $Rev: 3091 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@author Gilles Caulier (cgilles)
@@ -22,7 +22,7 @@
@file psdimage.hpp
@brief Photoshop image, implemented using the following references:
<a href="http://www.fine-view.com/jp/lab/doc/ps6ffspecsv2.pdf">Adobe Photoshop 6.0 File Format Specification</a> by Adobe<br>
@version $Rev$
@version $Rev: 3091 $
@author Marco Piovanelli, Ovolab (marco)
<a href="mailto:marco.piovanelli@pobox.com">marco.piovanelli@pobox.com</a>
@author Michael Ulbrich
@@ -21,7 +21,7 @@
/*!
@file rafimage.hpp
@brief Fujifilm RAW image
@version $Rev$
@version $Rev: 3090 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@date 05-Feb-07, ahu: created
@@ -21,7 +21,7 @@
/*!
@file rw2image.hpp
@brief Class Rw2Image
@version $Rev$
@version $Rev: 3090 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@date 06-Jan-09, ahu: created
+109
View File
@@ -0,0 +1,109 @@
// ***************************************************************** -*- C++ -*-
/*
* Copyright (C) 2004-2013 Andreas Huggel <ahuggel@gmx.net>
*
* This program is part of the Exiv2 distribution.
*
* 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 Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
*/
#ifndef SSH_HPP_
#define SSH_HPP_
// included header files
#include "config.h"
#if EXV_USE_SSH == 1
#include <libssh/libssh.h>
#include <libssh/sftp.h>
#include <sys/stat.h>
#include <string>
#include "error.hpp"
#include "types.hpp"
#include "futils.hpp"
namespace Exiv2 {
/*!
@brief The class provides the high-level functions related to libssh.
It makes the libssh transparent. The functions in this class can
be used without the requirement of understanding libssh.
*/
class EXIV2API SSH {
public:
//! @name Creators
//@{
/*!
@brief Constructor to set up the connection to ssh server.
@param host The host name of ssh server.
@param user The username used to connect to ssh server.
@param pass The password used to connect to ssh server.
@param port The port to connect to ssh server. Set empty string to use the default port.
@throw Error if it fails to connect the server.
*/
SSH (const std::string& host, const std::string& user, const std::string& pass, const std::string port = "");
//! Destructor
~SSH();
//@}
//! @name Manipulators
//@{
/*!
@brief Run the command on the remote machine.
@param cmd The command
@param output The container for the command's output
@return 0 (SSH_OK) if there is no error.
*/
int runCommand(const std::string& cmd, std::string* output);
/*!
@brief SCP data to the remote machine.
@param filePath The path of the new file on the remote machine where the data is saved.
@param data The data copied to the remote machine.
@param size The size of the data.
@return 0 (SSH_OK) if there is no error.
@throw Error if it is unable to copy the data.
*/
int scp(const std::string& filePath, const byte* data, size_t size);
/*!
@brief Return the sftp file handle of the file on the remote machine to read the data.
@param filePath The path of the file on the remote machine.
@param handle The container for the file handle.
@throw Error if it is unable to get the sftp file handle.
@note Be sure to close() the file handle after use.
*/
void getFileSftp(const std::string& filePath, sftp_file& handle);
//@}
private:
/*!
@brief Open the sftp session.
*/
void openSftp();
// DATA
//! The number of seconds to wait while trying to connect.
long timeout_;
//! the ssh server host
std::string host_;
//! the username
std::string user_;
//! the password
std::string pass_;
//! the ssh session
ssh_session session_;
//! the sftp session
sftp_session sftp_;
}; // class SSH
} // namespace Exiv2
#endif
#endif // #ifdef EXIV2_HPP_
+3
View File
@@ -0,0 +1,3 @@
#ifndef SVN_VERSION
#define SVN_VERSION 0
#endif
+1 -1
View File
@@ -21,7 +21,7 @@
/*!
@file tags.hpp
@brief Exif tag and type information
@version $Rev$
@version $Rev: 3090 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@date 15-Jan-04, ahu: created<BR>
@@ -23,7 +23,7 @@
@brief Truevision TARGA v2 image, implemented using the following references:
<a href="http://en.wikipedia.org/wiki/Truevision_TGA">Truevision TGA page on Wikipedia</a><br>
<a href="http://www.gamers.org/dEngine/quake3/TGA.ps.gz">TGA(tm) File Format Specification</a>
@version $Rev$
@version $Rev: 3090 $
@author Marco Piovanelli, Ovolab (marco)
<a href="mailto:marco.piovanelli@pobox.com">marco.piovanelli@pobox.com</a>
@date 05-Mar-2007, marco: created
@@ -21,7 +21,7 @@
/*!
@file tiffimage.hpp
@brief Class TiffImage
@version $Rev$
@version $Rev: 3090 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@date 15-Mar-06, ahu: created
+94
View File
@@ -0,0 +1,94 @@
/*!
@file timegm.h
@brief Declaration of timegm(). The implementation is in localtime.c
@version $Rev: 1800 $
*/
#ifndef TIMEGM_H_
#define TIMEGM_H_
#include <time.h>
/*
The following comments are copied from the Makefile of the tz distribution,
available at ftp://elsie.nci.nih.gov/pub/:
NIST-PCTS:151-2, Version 1.4, (1993-12-03) is a test suite put
out by the National Institute of Standards and Technology
which claims to test C and Posix conformance. If you want to pass PCTS, add
-DPCTS
to the end of the "CFLAGS=" line.
If your system has a "zone abbreviation" field in its "struct tm"s
(or if you decide to add such a field in your system's "time.h" file),
add the name to a define such as
-DTM_ZONE=tm_zone
or
-DTM_ZONE=_tm_zone
to the end of the "CFLAGS=" line.
If you want functions that were inspired by early versions of X3J11's work,
add
-DSTD_INSPIRED
to the end of the "CFLAGS=" line.
If you want to allocate state structures in localtime, add
-DALL_STATE
to the end of the "CFLAGS=" line. Storage is obtained by calling malloc.
If you want Source Code Control System ID's left out of object modules, add
-DNOID
Add the following to the end of the "CFLAGS=" line as needed.
-DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified
DST transitions if the time zone files cannot be accessed
If you want to use System V compatibility code, add
-DUSG_COMPAT
to the end of the "CFLAGS=" line. This arrange for "timezone" and "daylight"
variables to be kept up-to-date by the time conversion functions. Neither
"timezone" nor "daylight" is described in X3J11's work.
If you want an "altzone" variable (a la System V Release 3.1), add
-DALTZONE
to the end of the "CFLAGS=" line.
This variable is not described in X3J11's work.
If your system has a "GMT offset" field in its "struct tm"s
(or if you decide to add such a field in your system's "time.h" file),
add the name to a define such as
-DTM_GMTOFF=tm_gmtoff
or
-DTM_GMTOFF=_tm_gmtoff
to the end of the "CFLAGS=" line.
Neither tm_gmtoff nor _tm_gmtoff is described in X3J11's work;
in its work, use of "tm_gmtoff" is described as non-conforming.
Both Linux and BSD have done the equivalent of defining TM_GMTOFF in
their recent releases.
If you want a "gtime" function (a la MACH), add
-DCMUCS
to the end of the "CFLAGS=" line
This function is not described in X3J11's work.
*/
#define STD_INSPIRED
#define NOID
#ifdef __cplusplus
extern "C" {
#endif
// The UTC version of mktime
/* rmills - timegm is replaced with _mkgmtime on VC 2005 and up */
/* - see localtime.c */
#if !defined(_MSC_VER) || (_MSC_VER < 1400)
time_t timegm(struct tm * const tmp);
#else
#define timegm _mkgmtime
#endif
#ifdef __cplusplus
}
#endif
#endif // #ifndef TIMEGM_H_
+3 -21
View File
@@ -21,7 +21,7 @@
/*!
@file types.hpp
@brief Type definitions for %Exiv2 and related functionality
@version $Rev$
@version $Rev: 3090 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@date 09-Jan-04, ahu: created<BR>
@@ -31,19 +31,8 @@
#ifndef TYPES_HPP_
#define TYPES_HPP_
// *****************************************************************************
// included header files
#ifdef _MSC_VER
# include "exv_msvc.h"
#else
# include "exv_conf.h"
#endif
#if defined(__MINGW32__) || defined(__MINGW64__)
# ifndef __MINGW__
# define __MINGW__
# endif
#endif
#include "config.h"
#include "version.hpp"
@@ -74,13 +63,6 @@ typedef __int64 int64_t;
# define EXV_WIDEN(t) L ## t
#endif
#if defined(__MINGW__) || defined(_MSC_VER)
typedef unsigned char u_int8_t;
typedef unsigned short u_int16_t;
typedef unsigned int u_int32_t;
typedef unsigned long long u_int64_t;
#endif
/*!
@brief Macro to make calls to member functions through a pointer more readable.
See the C++ FAQ LITE, item
@@ -114,7 +96,7 @@ namespace Exiv2 {
typedef std::pair<int32_t, int32_t> Rational;
//! Type to express the byte order (little or big endian)
enum ByteOrder { invalidByteOrder, littleEndian, bigEndian };
enum ByteOrder { invalidByteOrder, littleEndian, bigEndian,asciiBytes };
//! Type to indicate write method used by TIFF parsers
enum WriteMethod { wmIntrusive, wmNonIntrusive };
+193
View File
@@ -0,0 +1,193 @@
/*!
@file tzfile.h
@brief This file is from the tz distribution at ftp://elsie.nci.nih.gov/pub/
@version $Rev: 392 $
*/
#ifndef TZFILE_H
#define TZFILE_H
/*
** This file is in the public domain, so clarified as of
** 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov).
*/
/*
** This header is for use ONLY with the time conversion code.
** There is no guarantee that it will remain unchanged,
** or that it will remain at all.
** Do NOT copy it to any system include directory.
** Thank you!
*/
/*
** ID
*/
#ifndef lint
#ifndef NOID
static char tzfilehid[] = "@(#)tzfile.h 7.14";
#endif /* !defined NOID */
#endif /* !defined lint */
/*
** Information about time zone files.
*/
#ifndef TZDIR
#define TZDIR "/usr/local/etc/zoneinfo" /* Time zone object file directory */
#endif /* !defined TZDIR */
#ifndef TZDEFAULT
#define TZDEFAULT "localtime"
#endif /* !defined TZDEFAULT */
#ifndef TZDEFRULES
#define TZDEFRULES "posixrules"
#endif /* !defined TZDEFRULES */
/*
** Each file begins with. . .
*/
#define TZ_MAGIC "TZif"
struct tzhead {
char tzh_magic[4]; /* TZ_MAGIC */
char tzh_reserved[16]; /* reserved for future use */
char tzh_ttisgmtcnt[4]; /* coded number of trans. time flags */
char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */
char tzh_leapcnt[4]; /* coded number of leap seconds */
char tzh_timecnt[4]; /* coded number of transition times */
char tzh_typecnt[4]; /* coded number of local time types */
char tzh_charcnt[4]; /* coded number of abbr. chars */
};
/*
** . . .followed by. . .
**
** tzh_timecnt (char [4])s coded transition times a la time(2)
** tzh_timecnt (unsigned char)s types of local time starting at above
** tzh_typecnt repetitions of
** one (char [4]) coded UTC offset in seconds
** one (unsigned char) used to set tm_isdst
** one (unsigned char) that's an abbreviation list index
** tzh_charcnt (char)s '\0'-terminated zone abbreviations
** tzh_leapcnt repetitions of
** one (char [4]) coded leap second transition times
** one (char [4]) total correction after above
** tzh_ttisstdcnt (char)s indexed by type; if TRUE, transition
** time is standard time, if FALSE,
** transition time is wall clock time
** if absent, transition times are
** assumed to be wall clock time
** tzh_ttisgmtcnt (char)s indexed by type; if TRUE, transition
** time is UTC, if FALSE,
** transition time is local time
** if absent, transition times are
** assumed to be local time
*/
/*
** In the current implementation, "tzset()" refuses to deal with files that
** exceed any of the limits below.
*/
#ifndef TZ_MAX_TIMES
/*
** The TZ_MAX_TIMES value below is enough to handle a bit more than a
** year's worth of solar time (corrected daily to the nearest second) or
** 138 years of Pacific Presidential Election time
** (where there are three time zone transitions every fourth year).
*/
#define TZ_MAX_TIMES 370
#endif /* !defined TZ_MAX_TIMES */
#ifndef TZ_MAX_TYPES
#ifndef NOSOLAR
#define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can hold */
#endif /* !defined NOSOLAR */
#ifdef NOSOLAR
/*
** Must be at least 14 for Europe/Riga as of Jan 12 1995,
** as noted by Earl Chew <earl@hpato.aus.hp.com>.
*/
#define TZ_MAX_TYPES 20 /* Maximum number of local time types */
#endif /* !defined NOSOLAR */
#endif /* !defined TZ_MAX_TYPES */
#ifndef TZ_MAX_CHARS
#define TZ_MAX_CHARS 50 /* Maximum number of abbreviation characters */
/* (limited by what unsigned chars can hold) */
#endif /* !defined TZ_MAX_CHARS */
#ifndef TZ_MAX_LEAPS
#define TZ_MAX_LEAPS 50 /* Maximum number of leap second corrections */
#endif /* !defined TZ_MAX_LEAPS */
#define SECSPERMIN 60
#define MINSPERHOUR 60
#define HOURSPERDAY 24
#define DAYSPERWEEK 7
#define DAYSPERNYEAR 365
#define DAYSPERLYEAR 366
#define SECSPERHOUR (SECSPERMIN * MINSPERHOUR)
#define SECSPERDAY ((long) SECSPERHOUR * HOURSPERDAY)
#define MONSPERYEAR 12
#define TM_SUNDAY 0
#define TM_MONDAY 1
#define TM_TUESDAY 2
#define TM_WEDNESDAY 3
#define TM_THURSDAY 4
#define TM_FRIDAY 5
#define TM_SATURDAY 6
#define TM_JANUARY 0
#define TM_FEBRUARY 1
#define TM_MARCH 2
#define TM_APRIL 3
#define TM_MAY 4
#define TM_JUNE 5
#define TM_JULY 6
#define TM_AUGUST 7
#define TM_SEPTEMBER 8
#define TM_OCTOBER 9
#define TM_NOVEMBER 10
#define TM_DECEMBER 11
#define TM_YEAR_BASE 1900
#define EPOCH_YEAR 1970
#define EPOCH_WDAY TM_THURSDAY
/*
** Accurate only for the past couple of centuries;
** that will probably do.
*/
#define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))
#ifndef USG
/*
** Use of the underscored variants may cause problems if you move your code to
** certain System-V-based systems; for maximum portability, use the
** underscore-free variants. The underscored variants are provided for
** backward compatibility only; they may disappear from future versions of
** this file.
*/
#define SECS_PER_MIN SECSPERMIN
#define MINS_PER_HOUR MINSPERHOUR
#define HOURS_PER_DAY HOURSPERDAY
#define DAYS_PER_WEEK DAYSPERWEEK
#define DAYS_PER_NYEAR DAYSPERNYEAR
#define DAYS_PER_LYEAR DAYSPERLYEAR
#define SECS_PER_HOUR SECSPERHOUR
#define SECS_PER_DAY SECSPERDAY
#define MONS_PER_YEAR MONSPERYEAR
#endif /* !defined USG */
#endif /* !defined TZFILE_H */
+2 -2
View File
@@ -21,7 +21,7 @@
/*!
@file utils.hpp
@brief A collection of utility functions
@version $Rev$
@version $Rev: 3090 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@date 12-Dec-03, ahu: created
@@ -33,7 +33,7 @@
// included header files
// + standard includes
#include <string>
#include <futils.hpp>
// *********************************************************************
// namespace extensions
/*!
+3 -3
View File
@@ -21,7 +21,7 @@
/*!
@file value.hpp
@brief Value interface and concrete subclasses
@version $Rev$
@version $Rev: 3090 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@date 09-Jan-04, ahu: created
@@ -1062,8 +1062,8 @@ namespace Exiv2 {
@brief %Value for simple ISO 8601 times.
This class is limited to handling simple time strings in the ISO 8601
format HHMMSS±HHMM where HHMMSS refers to local hour, minute and
seconds and ±HHMM refers to hours and minutes ahead or behind
format HHMMSSHHMM where HHMMSS refers to local hour, minute and
seconds and HHMM refers to hours and minutes ahead or behind
Universal Coordinated Time.
*/
class EXIV2API TimeValue : public Value {
@@ -24,7 +24,7 @@
References: Similar versioning defines are used in KDE, GTK and other
libraries. See http://apr.apache.org/versioning.html for accompanying
guidelines.
@version $Rev$
@version $Rev: 3371 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@date 31-May-06, ahu: created
@@ -37,13 +37,6 @@
// + standard includes
#include <string>
// svn version has not been implemented yet for DevStudio
#if defined(_MSC_VER) && !defined(CMAKE_BUILD_SVN)
#define SVN_VERSION 0
#else
#include "svn_version.h"
#endif
/*!
@brief %Exiv2 MAJOR version number of the library used at compile-time.
*/
+1 -1
View File
@@ -21,7 +21,7 @@
/*!
@file xmp.hpp
@brief Encoding and decoding of XMP data
@version $Rev$
@version $Rev: 3090 $
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@date 13-Jul-07, ahu: created
@@ -21,7 +21,7 @@
/*!
@file xmpsidecar.hpp
@brief An Image subclass to support XMP sidecar files
@version $Rev$
@version $Rev: 3090 $
@author Andreas Huggel
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@date 07-Mar-08, ahu: created
+35 -16
View File
@@ -26,6 +26,7 @@ if NOT DEFINED zlib set zlib=true
if NOT DEFINED curl set curl=false
if NOT DEFINED libssh set libssh=false
if NOT DEFINED openssl set openssl=false
if %openssl%==true set curl=true
if %ACTION%==/clean set tests=false
if %ACTION%==/upgrade set tests=false
@@ -35,26 +36,43 @@ if NOT DEFINED LIB set "LIB=C:\Program Files (x86)\Microsoft Visual St
if NOT DEFINED LIBPATH set "LIBPATH=C:\Windows\Microsoft.NET\Framework\v2.0.50727;C:\Program Files (x86)\Microsoft Visual Studio 8\VC\ATLMFC\LIB"
if NOT DEFINED VS80COMNTOOLS set "VS80COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\Tools\"
rem --
rem ----------------------------------------------
rem set the build environment
call "%VS80COMNTOOLS%\..\..\Vc\bin\vcvars32.bat"
rem --
rem Pull in support libraries
if NOT EXIST ..\expat-2.1.0 xcopy/yesihq c:\exiv2libs\expat-2.1.0 ..\expat-2.1.0
if NOT EXIST ..\zlib-1.2.7 xcopy/yesihq c:\exiv2libs\zlib-1.2.7 ..\zlib-1.2.7
rem ----------------------------------------------
rem copy the support libraries
xcopy/yesihq c:\exiv2libs\expat-2.1.0 ..\expat
xcopy/yesihq c:\exiv2libs\zlib-1.2.7 ..\zlib
xcopy/yesihq c:\exiv2libs\openssl-1.0.1j ..\openssl
xcopy/yesihq c:\exiv2libs\libssh-0.5.5 ..\libssh
xcopy/yesihq c:\exiv2libs\curl-7.39.0 ..\curl
rem --
rem build and test
rem ----------------------------------------------
pushd msvc2005
rem --
rem FOO is the current directory in cygwin (/cygdrive/c/users/shared/workspace/exiv2-trunk/label/msvc)
rem we need this to set the correct directory when we run the test suite from Cygwin
for /f "tokens=*" %%a in ('cygpath -au ..') do set FOO=%%a
copy exiv2.sln e.sln
set webready=false
if %curl% == true if %libssh% == true if %openssl% == true set webready=true
if %webready% == true (
copy/y exiv2-webready.sln e.sln
copy/y ..\include\exiv2\exv-msvc-webready.h ..\..\include\exiv2\exv-msvc.h
)
rem --
rem Now build and test
if %Win32%==true (
if %debug%==true (
if %static%==true (
devenv exiv2.sln %ACTION% "Debug|Win32"
devenv e.sln %ACTION% "Debug|Win32"
if %tests%==true (
call bash -c 'cd %FOO%;cd test;./testMSVC.sh ../msvc2005/bin/Win32/Debug'
) ) ) )
@@ -62,7 +80,7 @@ if %Win32%==true (
if %Win32%==true (
if %release%==true (
if %static%==true (
devenv exiv2.sln %ACTION% "Release|Win32"
devenv e.sln %ACTION% "Release|Win32"
if %tests%==true (
call bash -c 'cd %FOO%;cd test;./testMSVC.sh ../msvc2005/bin/Win32/Release'
) ) ) )
@@ -70,7 +88,7 @@ if %Win32%==true (
if %Win32%==true (
if %debug%==true (
if %dll%==true (
devenv exiv2.sln %ACTION% "DebugDLL|Win32"
devenv e.sln %ACTION% "DebugDLL|Win32"
if %tests%==true (
call bash -c 'cd %FOO%;cd test;./testMSVC.sh ../msvc2005/bin/Win32/DebugDLL'
) ) ) )
@@ -78,7 +96,7 @@ if %Win32%==true (
if %Win32%==true (
if %release%==true (
if %dll%==true (
devenv exiv2.sln %ACTION% "ReleaseDLL|Win32"
devenv e.sln %ACTION% "ReleaseDLL|Win32"
if %tests%==true (
call bash -c 'cd %FOO%;cd test;./testMSVC.sh ../msvc2005/bin/Win32/ReleaseDLL'
) ) ) )
@@ -86,7 +104,7 @@ if %Win32%==true (
if %x64%==true (
if %debug%==true (
if %static%==true (
devenv exiv2.sln %ACTION% "Debug|x64"
devenv e.sln %ACTION% "Debug|x64"
if %tests%==true (
call bash -c 'cd %FOO%;cd test;./testMSVC.sh ../msvc2005/bin/x64/Debug'
) ) ) )
@@ -94,7 +112,7 @@ if %x64%==true (
if %x64%==true (
if %release%==true (
if %static%==true (
devenv exiv2.sln %ACTION% "Release|x64"
devenv e.sln %ACTION% "Release|x64"
if %tests%==true (
call bash -c 'cd %FOO%;cd test;./testMSVC.sh ../msvc2005/bin/x64/Release'
) ) ) )
@@ -102,7 +120,7 @@ if %x64%==true (
if %x64%==true (
if %debug%==true (
if %dll%==true (
devenv exiv2.sln %ACTION% "DebugDLL|x64"
devenv e.sln %ACTION% "DebugDLL|x64"
if %tests%==true (
call bash -c 'cd %FOO%;cd test;./testMSVC.sh ../msvc2005/bin/x64/DebugDLL'
) ) ) )
@@ -110,15 +128,16 @@ if %x64%==true (
if %x64%==true (
if %release%==true (
if %dll%==true (
devenv exiv2.sln %ACTION% "ReleaseDLL|x64"
devenv e.sln %ACTION% "ReleaseDLL|x64"
if %tests%==true (
call bash -c 'cd %FOO%;cd test;./testMSVC.sh ../msvc2005/bin/x64/ReleaseDLL'
) ) ) )
del e.sln
popd
rem delete the support libraries (with mozilla's native rm utility)
msvc2005\tools\bin\rm.exe -rf ..\expat-2.1.0 ..\zlib-1.2.7
msvc2005\tools\bin\rm.exe -rf ..\expat ..\zlib ..\openssl ..\libssh ..\curl
rem That's all Folks!
rem -----------------
+3 -6
View File
@@ -153,7 +153,7 @@ if [ $PLATFORM == "macosx" -a "$target" == "macosx" -a "$macosx" == "true" ]; t
if [ $PLATFORM == "cygwin" -a "$target" == "cygwin" -a "$cygwin" == "true" ]; then build=CYGW ; fi
if [ $PLATFORM == "cygwin" -a "$target" == "mingw" -a "$mingw" == "true" ]; then build=MING ; fi
if [ $PLATFORM == "cygwin" -a "$target" == "msvc" -a "$msvc" == "true" ]; then build=MSVC ; fi
if [ $PLATFORM == "mingw" -a "$target" == "mingw" ]; then build=MING ; fi
if [ $PLATFORM == "mingw" -a "$target" == "mingw" ]; then build=MING ; fi
echo "3 target = $target platform = $PLATFORM build = $build"
@@ -162,14 +162,13 @@ case "$build" in
echo -------------
echo ./configure --prefix=$PWD/usr $withcurl $withssh
echo -------------
./configure --prefix=$PWD/usr $withcurl $withssh
(cd src ; make svn_version.h)
./configure "--prefix=$PWD/usr" $withcurl $withssh
make -j4 "LDFLAGS=-L${PWD}/usr/lib -L${PWD}/xmpsdk/src/.libs"
make install
make -j4 samples "CXXFLAGS=-I${PWD}/usr/include -I${PWD}/src" "LDFLAGS=-L${PWD}/usr/lib -L${PWD}/xmpsdk/src/.libs -lexiv2"
result=$?
run_tests
exiv2 -v -V
"$PWD/usr/bin/exiv2" -v -V
;;
CYGW)
@@ -178,7 +177,6 @@ case "$build" in
# 1. trying to get Cygwin to build with gettext and friends
# 2. trying to get Cygwin to install into a local directory
./configure --disable-nls $withcurl $withssh
(cd src ; make svn_version.h)
make -j4
# result=$?
make install
@@ -215,7 +213,6 @@ case "$build" in
fi
./configure $withcurl $withssh
(cd src ; make svn_version.h)
make # DO NOT USE -j4. It seems to hang the build!
make install
make samples
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More