|
|
@ -69,9 +69,15 @@ EXIV2_RCSID("@(#) $Id$")
|
|
|
|
# include <XMP.incl_cpp>
|
|
|
|
# include <XMP.incl_cpp>
|
|
|
|
#include "xmp.hpp"
|
|
|
|
#include "xmp.hpp"
|
|
|
|
|
|
|
|
|
|
|
|
static XMP_Status namespaceDumper ( void* /*refCon*/
|
|
|
|
typedef struct {
|
|
|
|
, XMP_StringPtr buffer
|
|
|
|
std::ostream& os;
|
|
|
|
, XMP_StringLen bufferSize
|
|
|
|
const char* name;
|
|
|
|
|
|
|
|
} NSDumper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static XMP_Status namespaceDumper
|
|
|
|
|
|
|
|
( void* refCon
|
|
|
|
|
|
|
|
, XMP_StringPtr buffer
|
|
|
|
|
|
|
|
, XMP_StringLen bufferSize
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
XMP_Status result = 0 ;
|
|
|
|
XMP_Status result = 0 ;
|
|
|
|
std::string out(buffer,bufferSize);
|
|
|
|
std::string out(buffer,bufferSize);
|
|
|
@ -83,9 +89,10 @@ static XMP_Status namespaceDumper ( void* /*refCon*/
|
|
|
|
bool bHttp = out.find("http://") != std::string::npos ;
|
|
|
|
bool bHttp = out.find("http://") != std::string::npos ;
|
|
|
|
bool bNS = out.find(":") != std::string::npos && !bHttp;
|
|
|
|
bool bNS = out.find(":") != std::string::npos && !bHttp;
|
|
|
|
if ( bHttp || bNS ) {
|
|
|
|
if ( bHttp || bNS ) {
|
|
|
|
if ( bNS ) std::cout << "xmlns=" ;
|
|
|
|
NSDumper* nsDumper = (NSDumper*) refCon;
|
|
|
|
std::cout << out ;
|
|
|
|
if ( bNS ) nsDumper->os << nsDumper->name << "=" ;
|
|
|
|
if ( bHttp ) std::cout << std::endl;
|
|
|
|
nsDumper->os << out ;
|
|
|
|
|
|
|
|
if ( bHttp ) nsDumper->os << std::endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -165,7 +172,7 @@ typedef string_v::iterator string_i;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
static void output(std::ostream& os,const exv_grep_keys_t& greps,const char* name,const std::string& value)
|
|
|
|
static bool shouldOutput(const exv_grep_keys_t& greps,const char* name,const std::string& value)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool bPrint = greps.empty();
|
|
|
|
bool bPrint = greps.empty();
|
|
|
|
for( exv_grep_keys_t::const_iterator g = greps.begin();
|
|
|
|
for( exv_grep_keys_t::const_iterator g = greps.begin();
|
|
|
@ -179,7 +186,12 @@ static void output(std::ostream& os,const exv_grep_keys_t& greps,const char* nam
|
|
|
|
bPrint = std::string(name).find(*g) != std::string::npos || value.find(*g) != std::string::npos;
|
|
|
|
bPrint = std::string(name).find(*g) != std::string::npos || value.find(*g) != std::string::npos;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( bPrint ) os << name << "=" << value << endl;
|
|
|
|
return bPrint;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void output(std::ostream& os,const exv_grep_keys_t& greps,const char* name,const std::string& value)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if ( shouldOutput(greps,name,value) ) os << name << "=" << value << endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void output(std::ostream& os,const exv_grep_keys_t& greps,const char* name,int value)
|
|
|
|
static void output(std::ostream& os,const exv_grep_keys_t& greps,const char* name,int value)
|
|
|
@ -545,7 +557,11 @@ void Exiv2::dumpLibraryInfo(std::ostream& os,const exv_grep_keys_t& keys)
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef EXV_HAVE_XMP_TOOLKIT
|
|
|
|
#ifdef EXV_HAVE_XMP_TOOLKIT
|
|
|
|
Exiv2::XmpParser::initialize();
|
|
|
|
Exiv2::XmpParser::initialize();
|
|
|
|
SXMPMeta::DumpNamespaces(namespaceDumper,NULL);
|
|
|
|
const char* name = "xmlns";
|
|
|
|
|
|
|
|
NSDumper nsDumper = { os,name };
|
|
|
|
|
|
|
|
if ( shouldOutput(keys,name,"") ) {
|
|
|
|
|
|
|
|
SXMPMeta::DumpNamespaces(namespaceDumper,&nsDumper);
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(__linux__)
|
|
|
|
#if defined(__linux__)
|
|
|
|