Created
June 21, 2012 21:06
-
-
Save chebert/2968537 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| bool Create::Params::CreateProperties::Populate(const Value& value, CreateProperties* out) { | |
| Value* contexts_value = NULL; | |
| if (dict->GetWithoutPathExpansion("contexts", &contexts_value)) { | |
| { | |
| ListValue* list = NULL; | |
| if (!contexts_value->GetAsList(&list)) | |
| return false; | |
| for (ListValue::iterator it = list->begin(); it != list->end(); ++it) { | |
| std::string enum_temp; | |
| if (!(*it)->GetAsString(&enum_temp)) | |
| return false; | |
| if(enum_temp == "all") | |
| out->contexts->push_back(CONTEXTS_ELEMENT_ALL); | |
| else if(enum_temp == "page") | |
| out->contexts->push_back(CONTEXTS_ELEMENT_PAGE); | |
| else if(enum_temp == "frame") | |
| out->contexts->push_back(CONTEXTS_ELEMENT_FRAME); | |
| else if(enum_temp == "selection") | |
| out->contexts->push_back(CONTEXTS_ELEMENT_SELECTION); | |
| else if(enum_temp == "link") | |
| out->contexts->push_back(CONTEXTS_ELEMENT_LINK); | |
| else if(enum_temp == "editable") | |
| out->contexts->push_back(CONTEXTS_ELEMENT_EDITABLE); | |
| else if(enum_temp == "image") | |
| out->contexts->push_back(CONTEXTS_ELEMENT_IMAGE); | |
| else if(enum_temp == "video") | |
| out->contexts->push_back(CONTEXTS_ELEMENT_VIDEO); | |
| else if(enum_temp == "audio") | |
| out->contexts->push_back(CONTEXTS_ELEMENT_AUDIO); | |
| else | |
| return false; | |
| } | |
| } | |
| } | |
| return true; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment