Mercurial > cgi-bin > hgweb.cgi > JpegWasher
diff src/name/blackcap/exifwasher/exiv2/native.cpp @ 22:cd2ca4727b7f
Builds under Windows.
author | davidb |
---|---|
date | Thu, 16 Apr 2020 11:10:39 -0700 |
parents | a59d84674fb0 |
children |
line wrap: on
line diff
--- a/src/name/blackcap/exifwasher/exiv2/native.cpp Sun Apr 12 18:46:57 2020 -0700 +++ b/src/name/blackcap/exifwasher/exiv2/native.cpp Thu Apr 16 11:10:39 2020 -0700 @@ -100,6 +100,20 @@ /* Header for class name_blackcap_exifwasher_exiv2_ExifData */ /* + * Utility function to parse out a type prefix from a key name. + */ +char *getType(const char *key) { + const char *dot = strchr(key, '.'); + if (dot == NULL) + throw std::invalid_argument(std::string("invalid key: ") + std::string(key)); + int length = dot - key; + char *ret = (char *) malloc(length + 1); + memcpy(ret, key, length); + ret[length] = '\0'; + return ret; +} + +/* * Utility function to delete a (key, value) pair. */ template<class D, class K> @@ -148,20 +162,6 @@ #endif /* - * Utility function to parse out a type prefix from a key name. - */ -char *getType(const char *key) { - char *dot = strchr(key, '.'); - if (dot == NULL) - throw std::invalid_argument(std::string("invalid key: ") + std::string(key)); - int length = dot - key; - char *ret = (char *) malloc(length + 1); - memcpy(ret, key, length); - ret[length] = '\0'; - return ret; -} - -/* * Class: name_blackcap_exifwasher_exiv2_ExifData * Method: _erase * Signature: (Ljava/lang/String;)V