@staticmethod<EOL><INDENT>def find_value_type(global_ns, value_type_str):<DEDENT>
if not value_type_str.startswith('<STR_LIT>'):<EOL><INDENT>value_type_str = '<STR_LIT>' + value_type_str<EOL><DEDENT>found = global_ns.decls(<EOL>name=value_type_str,<EOL>function=lambda decl: not isinstance(decl, calldef.calldef_t),<EOL>allow_empty=True)<EOL>if not found:<EOL><INDENT>no_global_ns_value_type_str = value_type_str[<NUM_LIT:2>:]<EOL>if no_global_ns_value_type_str in cpptypes.FUNDAMENTAL_TYPES:<EOL><INDENT>return cpptypes.FUNDAMENTAL_TYPES[no_global_ns_value_type_str]<EOL><DEDENT>elif type_traits.is_std_string(value_type_str):<EOL><INDENT>string_ = global_ns.typedef('<STR_LIT>')<EOL>return type_traits.remove_declarated(string_)<EOL><DEDENT>elif type_traits.is_std_wstring(value_type_str):<EOL><INDENT>string_ = global_ns.typedef('<STR_LIT>')<EOL>return type_traits.remove_declarated(string_)<EOL><DEDENT>else:<EOL><INDENT>value_type_str = no_global_ns_value_type_str<EOL>has_const = value_type_str.startswith('<STR_LIT>')<EOL>if has_const:<EOL><INDENT>value_type_str = value_type_str[len('<STR_LIT>'):]<EOL><DEDENT>has_pointer = value_type_str.endswith('<STR_LIT:*>')<EOL>if has_pointer:<EOL><INDENT>value_type_str = value_type_str[:-<NUM_LIT:1>]<EOL><DEDENT>found = None<EOL>if has_const or has_pointer:<EOL><INDENT>found = impl_details.find_value_type(<EOL>global_ns,<EOL>value_type_str)<EOL><DEDENT>if not found:<EOL><INDENT>return None<EOL><DEDENT>else:<EOL><INDENT>if isinstance(found, class_declaration.class_types):<EOL><INDENT>return cpptypes.declarated_t(found)<EOL><DEDENT>if has_const:<EOL><INDENT>return cpptypes.const_t(found)<EOL><DEDENT>if has_pointer:<EOL><INDENT>return cpptypes.pointer_t(found)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>if len(found) == <NUM_LIT:1>:<EOL><INDENT>return found[<NUM_LIT:0>]<EOL><DEDENT>return None<EOL>
implementation details