Remove rest of useless typedefs from datasets.hpp

This commit is contained in:
Luis Díaz Más 2021-04-18 20:19:14 +02:00
parent 01a3bc716d
commit 75e4bd9059
6 changed files with 17 additions and 61 deletions

View File

@ -362,50 +362,6 @@ namespace Exiv2 {
@brief typedef for string:string map
*/
typedef std::map<std::string,std::string> Dictionary;
/*!
@brief typedef for Dictionary*
*/
typedef Dictionary* Dictionary_p;
/*!
@brief typedef for string set (unique strings)
*/
typedef std::set<std::string> StringSet;
/*!
@brief typedef for StringSet*
*/
typedef StringSet* StringSet_p;
/*!
@brief Class to provide a StringSet iterator
*/
typedef std::set<std::string>::const_iterator StringSet_i;
/*!
@brief typedef for string vector
*/
typedef std::vector<std::string> StringVector;
/*!
@brief typedef for StringVector pointer
*/
typedef StringVector* StringVector_p;
/*!
@brief Class to provide a StringVector iterator
*/
typedef StringVector::const_iterator StringVector_i;
/*!
@brief typedef for uint32_t vector
*/
typedef std::vector<uint32_t> Uint32Vector ;
/*!
@brief typedef for Uint32Vector pointer
*/
typedef Uint32Vector* Uint32Vector_p;
/*!
@brief typedef for Uint32Vector iterator
*/
typedef Uint32Vector::const_iterator Uint32Vector_i;
// *****************************************************************************
// free functions

View File

@ -63,7 +63,7 @@ struct Token {
typedef std::vector<Token> Tokens;
// "XMP.xmp.MP.RegionInfo/MPRI:Regions[1]/MPReg:Rectangle"
bool getToken(std::string& in,Token& token,Exiv2::StringSet* pNS=NULL)
bool getToken(std::string& in,Token& token, std::set<std::string>* pNS=NULL)
{
bool result = false;
bool ns = false;
@ -118,7 +118,7 @@ Jzon::Node& recursivelyBuildTree(Jzon::Node& root,Tokens& tokens,size_t k)
}
// build the json tree for this key. return location and discover the name
Jzon::Node& objectForKey(const std::string& Key,Jzon::Object& root,std::string& name,Exiv2::StringSet* pNS=NULL)
Jzon::Node& objectForKey(const std::string& Key,Jzon::Object& root,std::string& name,std::set<std::string>* pNS=NULL)
{
// Parse the key
Tokens tokens ;
@ -339,8 +339,8 @@ int main(int argc, char* const argv[])
Exiv2::XmpData &xmpData = image->xmpData();
if ( !xmpData.empty() ) {
// get the xmpData and recursively parse into a Jzon Object
Exiv2::StringSet namespaces;
for (Exiv2::XmpData::const_iterator i = xmpData.begin(); i != xmpData.end(); ++i) {
std::set<std::string> namespaces;
for (auto i = xmpData.begin(); i != xmpData.end(); ++i) {
std::string name ;
Jzon::Node& object = objectForKey(i->key(),root,name,&namespaces);
push(object,name,i);
@ -352,7 +352,7 @@ int main(int argc, char* const argv[])
// create and populate a Jzon::Object for the namespaces
Jzon::Object xmlns;
for ( Exiv2::StringSet_i it = namespaces.begin() ; it != namespaces.end() ; it++ ) {
for ( auto it = namespaces.begin() ; it != namespaces.end() ; it++ ) {
std::string ns = *it ;
std::string uri = nsDict[ns];
xmlns.Add(ns,uri);

View File

@ -583,7 +583,7 @@ namespace Exiv2 {
}
bool bPrint = option == kpsBasic || option == kpsRecursive;
Exiv2::Uint32Vector iptcDataSegs;
std::vector<uint32_t> iptcDataSegs;
if (bPrint || option == kpsXMP || option == kpsIccProfile || option == kpsIptcErase) {
// nmonic for markers
@ -850,7 +850,7 @@ namespace Exiv2 {
uint64_t* pos = new uint64_t[count + 2];
pos[0] = 0;
// copy the data that is not iptc
Uint32Vector_i it = iptcDataSegs.begin();
auto it = iptcDataSegs.begin();
for (uint64_t i = 0; i < count; i++) {
bool bOdd = (i % 2) != 0;
bool bEven = !bOdd;

View File

@ -2163,7 +2163,7 @@ namespace Exiv2 {
std::string maxAperture = getKeyString("Exif.Photo.MaxApertureValue" ,metadata);
std::string F1_8 = "434/256" ;
Exiv2::StringSet maxApertures;
std::set<std::string> maxApertures;
maxApertures.insert( "926/256") ; // F3.5
maxApertures.insert("1024/256") ; // F4
maxApertures.insert("1110/256") ; // F4.5

View File

@ -150,7 +150,7 @@ static void output(std::ostream& os,const exv_grep_keys_t& greps,const char* nam
output(os,greps,name,stringStream.str());
}
static bool pushPath(std::string& path,Exiv2::StringVector& libs,Exiv2::StringSet& paths)
static bool pushPath(std::string& path,std::vector<std::string>& libs,std::set<std::string>& paths)
{
bool result = Exiv2::fileExists(path,true) && paths.find(path) == paths.end() && path != "/" ;
if ( result ) {
@ -160,10 +160,10 @@ static bool pushPath(std::string& path,Exiv2::StringVector& libs,Exiv2::StringSe
return result ;
}
static Exiv2::StringVector getLoadedLibraries()
static std::vector<std::string> getLoadedLibraries()
{
Exiv2::StringVector libs ;
Exiv2::StringSet paths;
std::vector<std::string> libs ;
std::set<std::string> paths;
std::string path ;
#if defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW__)
@ -476,7 +476,7 @@ void Exiv2::dumpLibraryInfo(std::ostream& os,const exv_grep_keys_t& keys)
use_curl=1;
#endif
Exiv2::StringVector libs =getLoadedLibraries();
std::vector<std::string> libs =getLoadedLibraries();
output(os,keys,"exiv2",Exiv2::versionString());
output(os,keys,"platform" , platform );
@ -507,7 +507,7 @@ void Exiv2::dumpLibraryInfo(std::ostream& os,const exv_grep_keys_t& keys)
output(os,keys,"curl" , use_curl);
if ( libs.begin() != libs.end() ) {
output(os,keys,"executable" ,*libs.begin());
for ( Exiv2::StringVector_i lib = libs.begin()+1 ; lib != libs.end() ; ++lib )
for ( auto lib = libs.begin()+1 ; lib != libs.end() ; ++lib )
output(os,keys,"library",*lib);
}

View File

@ -392,7 +392,7 @@ namespace Exiv2 {
// The side effects are avoided by the two-step approach
// https://github.com/Exiv2/exiv2/issues/560
std::string key(pos->key());
Exiv2::StringVector keys;
std::vector<std::string> keys;
while ( pos != xmpMetadata_.end() ) {
if ( pos->key().find(key)==0 ) {
keys.push_back(pos->key());
@ -402,8 +402,8 @@ namespace Exiv2 {
}
}
// now erase the family!
for ( Exiv2::StringVector_i it = keys.begin() ; it != keys.end() ; it++ ) {
erase(findKey(Exiv2::XmpKey(*it)));
for (const auto& key: keys) {
erase(findKey(Exiv2::XmpKey(key)));
}
}