Add support for MacOS and old compilers (not supporting C++11). Main patch is from Samuel Marks.
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
along with libgourou. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <cctype>
|
||||
#include <fulfillment_item.h>
|
||||
#include <libgourou_common.h>
|
||||
#include "user.h"
|
||||
@@ -93,8 +94,12 @@ namespace gourou
|
||||
std::string FulfillmentItem::getMetadata(std::string name)
|
||||
{
|
||||
// https://stackoverflow.com/questions/313970/how-to-convert-an-instance-of-stdstring-to-lower-case
|
||||
#if __STDC_VERSION__ >= 201112L
|
||||
std::transform(name.begin(), name.end(), name.begin(),
|
||||
[](unsigned char c){ return std::tolower(c); });
|
||||
#else
|
||||
std::transform(name.begin(), name.end(), name.begin(), tolower);
|
||||
#endif
|
||||
name = std::string("dc:") + name;
|
||||
pugi::xpath_node path = metadatas.select_node(name.c_str());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user