-
-
Save elubow/825135 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::string tag_key, tag_value; | |
bool has_tags = false; | |
map<string,string> tags; | |
if (!args[1]->IsUndefined()) { | |
Local<Object> tagsObj = args[1]->ToObject(); | |
Local<Array> tagNames = tagsObj->GetPropertyNames(); | |
uint32_t length = tagNames->Length(); | |
for (uint32_t i=0; i<length;i++) { | |
Local<String> v8TagKey = tagNames->Get(i)->ToString(); | |
Local<String> v8TagValue = tagsObj->Get(v8TagKey)->ToString(); | |
std::string tagKey(*String::AsciiValue(v8TagKey)); | |
std::string tagValue(*String::AsciiValue(v8TagValue)); | |
tags[tagKey] = tagValue; | |
} | |
has_tags = true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment