id int32 0 252k | repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 |
|---|---|---|---|---|---|---|---|---|---|---|---|
3,200 | gccxml/pygccxml | pygccxml/parser/directory_cache.py | directory_cache_t._write_file | def _write_file(self, filename, data):
"""Write a data item into a file.
The data object is written to a file using the pickle mechanism.
:param filename: Output file name
:type filename: str
:param data: A Python object that will be pickled
"""
if self.__compr... | python | def _write_file(self, filename, data):
"""Write a data item into a file.
The data object is written to a file using the pickle mechanism.
:param filename: Output file name
:type filename: str
:param data: A Python object that will be pickled
"""
if self.__compr... | [
"def",
"_write_file",
"(",
"self",
",",
"filename",
",",
"data",
")",
":",
"if",
"self",
".",
"__compression",
":",
"f",
"=",
"gzip",
".",
"GzipFile",
"(",
"filename",
",",
"\"wb\"",
")",
"else",
":",
"f",
"=",
"open",
"(",
"filename",
",",
"\"wb\"",... | Write a data item into a file.
The data object is written to a file using the pickle mechanism.
:param filename: Output file name
:type filename: str
:param data: A Python object that will be pickled | [
"Write",
"a",
"data",
"item",
"into",
"a",
"file",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/parser/directory_cache.py#L282-L297 |
3,201 | gccxml/pygccxml | pygccxml/parser/directory_cache.py | directory_cache_t._remove_entry | def _remove_entry(self, source_file, key):
"""Remove an entry from the cache.
source_file is the name of the header and key is its corresponding
cache key (obtained by a call to :meth:_create_cache_key ).
The entry is removed from the index table, any referenced file
name is rel... | python | def _remove_entry(self, source_file, key):
"""Remove an entry from the cache.
source_file is the name of the header and key is its corresponding
cache key (obtained by a call to :meth:_create_cache_key ).
The entry is removed from the index table, any referenced file
name is rel... | [
"def",
"_remove_entry",
"(",
"self",
",",
"source_file",
",",
"key",
")",
":",
"entry",
"=",
"self",
".",
"__index",
".",
"get",
"(",
"key",
")",
"if",
"entry",
"is",
"None",
":",
"return",
"# Release the referenced files...",
"for",
"id_",
",",
"_",
"in... | Remove an entry from the cache.
source_file is the name of the header and key is its corresponding
cache key (obtained by a call to :meth:_create_cache_key ).
The entry is removed from the index table, any referenced file
name is released and the cache file is deleted.
If key r... | [
"Remove",
"an",
"entry",
"from",
"the",
"cache",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/parser/directory_cache.py#L299-L333 |
3,202 | gccxml/pygccxml | pygccxml/parser/directory_cache.py | directory_cache_t._create_cache_key | def _create_cache_key(source_file):
"""
return the cache key for a header file.
:param source_file: Header file name
:type source_file: str
:rtype: str
"""
path, name = os.path.split(source_file)
return name + str(hash(path)) | python | def _create_cache_key(source_file):
"""
return the cache key for a header file.
:param source_file: Header file name
:type source_file: str
:rtype: str
"""
path, name = os.path.split(source_file)
return name + str(hash(path)) | [
"def",
"_create_cache_key",
"(",
"source_file",
")",
":",
"path",
",",
"name",
"=",
"os",
".",
"path",
".",
"split",
"(",
"source_file",
")",
"return",
"name",
"+",
"str",
"(",
"hash",
"(",
"path",
")",
")"
] | return the cache key for a header file.
:param source_file: Header file name
:type source_file: str
:rtype: str | [
"return",
"the",
"cache",
"key",
"for",
"a",
"header",
"file",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/parser/directory_cache.py#L336-L345 |
3,203 | gccxml/pygccxml | pygccxml/parser/directory_cache.py | directory_cache_t._create_cache_filename | def _create_cache_filename(self, source_file):
"""
return the cache file name for a header file.
:param source_file: Header file name
:type source_file: str
:rtype: str
"""
res = self._create_cache_key(source_file) + ".cache"
return os.path.join(self.__di... | python | def _create_cache_filename(self, source_file):
"""
return the cache file name for a header file.
:param source_file: Header file name
:type source_file: str
:rtype: str
"""
res = self._create_cache_key(source_file) + ".cache"
return os.path.join(self.__di... | [
"def",
"_create_cache_filename",
"(",
"self",
",",
"source_file",
")",
":",
"res",
"=",
"self",
".",
"_create_cache_key",
"(",
"source_file",
")",
"+",
"\".cache\"",
"return",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"__dir",
",",
"res",
")"
] | return the cache file name for a header file.
:param source_file: Header file name
:type source_file: str
:rtype: str | [
"return",
"the",
"cache",
"file",
"name",
"for",
"a",
"header",
"file",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/parser/directory_cache.py#L347-L356 |
3,204 | gccxml/pygccxml | pygccxml/parser/directory_cache.py | directory_cache_t._create_config_signature | def _create_config_signature(config):
"""
return the signature for a config object.
The signature is computed as sha1 digest of the contents of
working_directory, include_paths, define_symbols and
undefine_symbols.
:param config: Configuration object
:type confi... | python | def _create_config_signature(config):
"""
return the signature for a config object.
The signature is computed as sha1 digest of the contents of
working_directory, include_paths, define_symbols and
undefine_symbols.
:param config: Configuration object
:type confi... | [
"def",
"_create_config_signature",
"(",
"config",
")",
":",
"m",
"=",
"hashlib",
".",
"sha1",
"(",
")",
"m",
".",
"update",
"(",
"config",
".",
"working_directory",
".",
"encode",
"(",
"\"utf-8\"",
")",
")",
"for",
"p",
"in",
"config",
".",
"include_path... | return the signature for a config object.
The signature is computed as sha1 digest of the contents of
working_directory, include_paths, define_symbols and
undefine_symbols.
:param config: Configuration object
:type config: :class:`parser.xml_generator_configuration_t`
:... | [
"return",
"the",
"signature",
"for",
"a",
"config",
"object",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/parser/directory_cache.py#L359-L381 |
3,205 | gccxml/pygccxml | pygccxml/parser/directory_cache.py | filename_repository_t.acquire_filename | def acquire_filename(self, name):
"""Acquire a file name and return its id and its signature.
"""
id_ = self.__id_lut.get(name)
# Is this a new entry?
if id_ is None:
# then create one...
id_ = self.__next_id
self.__next_id += 1
se... | python | def acquire_filename(self, name):
"""Acquire a file name and return its id and its signature.
"""
id_ = self.__id_lut.get(name)
# Is this a new entry?
if id_ is None:
# then create one...
id_ = self.__next_id
self.__next_id += 1
se... | [
"def",
"acquire_filename",
"(",
"self",
",",
"name",
")",
":",
"id_",
"=",
"self",
".",
"__id_lut",
".",
"get",
"(",
"name",
")",
"# Is this a new entry?",
"if",
"id_",
"is",
"None",
":",
"# then create one...",
"id_",
"=",
"self",
".",
"__next_id",
"self"... | Acquire a file name and return its id and its signature. | [
"Acquire",
"a",
"file",
"name",
"and",
"return",
"its",
"id",
"and",
"its",
"signature",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/parser/directory_cache.py#L466-L484 |
3,206 | gccxml/pygccxml | pygccxml/parser/directory_cache.py | filename_repository_t.release_filename | def release_filename(self, id_):
"""Release a file name.
"""
entry = self.__entries.get(id_)
if entry is None:
raise ValueError("Invalid filename id (%d)" % id_)
# Decrease reference count and check if the entry has to be removed...
if entry.dec_ref_count() ... | python | def release_filename(self, id_):
"""Release a file name.
"""
entry = self.__entries.get(id_)
if entry is None:
raise ValueError("Invalid filename id (%d)" % id_)
# Decrease reference count and check if the entry has to be removed...
if entry.dec_ref_count() ... | [
"def",
"release_filename",
"(",
"self",
",",
"id_",
")",
":",
"entry",
"=",
"self",
".",
"__entries",
".",
"get",
"(",
"id_",
")",
"if",
"entry",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"Invalid filename id (%d)\"",
"%",
"id_",
")",
"# Decrease re... | Release a file name. | [
"Release",
"a",
"file",
"name",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/parser/directory_cache.py#L486-L497 |
3,207 | gccxml/pygccxml | pygccxml/parser/directory_cache.py | filename_repository_t.is_file_modified | def is_file_modified(self, id_, signature):
"""Check if the file referred to by `id_` has been modified.
"""
entry = self.__entries.get(id_)
if entry is None:
raise ValueError("Invalid filename id_ (%d)" % id_)
# Is the signature already known?
if entry.sig_... | python | def is_file_modified(self, id_, signature):
"""Check if the file referred to by `id_` has been modified.
"""
entry = self.__entries.get(id_)
if entry is None:
raise ValueError("Invalid filename id_ (%d)" % id_)
# Is the signature already known?
if entry.sig_... | [
"def",
"is_file_modified",
"(",
"self",
",",
"id_",
",",
"signature",
")",
":",
"entry",
"=",
"self",
".",
"__entries",
".",
"get",
"(",
"id_",
")",
"if",
"entry",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"Invalid filename id_ (%d)\"",
"%",
"id_",
... | Check if the file referred to by `id_` has been modified. | [
"Check",
"if",
"the",
"file",
"referred",
"to",
"by",
"id_",
"has",
"been",
"modified",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/parser/directory_cache.py#L499-L517 |
3,208 | gccxml/pygccxml | pygccxml/parser/directory_cache.py | filename_repository_t.update_id_counter | def update_id_counter(self):
"""Update the `id_` counter so that it doesn't grow forever.
"""
if not self.__entries:
self.__next_id = 1
else:
self.__next_id = max(self.__entries.keys()) + 1 | python | def update_id_counter(self):
"""Update the `id_` counter so that it doesn't grow forever.
"""
if not self.__entries:
self.__next_id = 1
else:
self.__next_id = max(self.__entries.keys()) + 1 | [
"def",
"update_id_counter",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"__entries",
":",
"self",
".",
"__next_id",
"=",
"1",
"else",
":",
"self",
".",
"__next_id",
"=",
"max",
"(",
"self",
".",
"__entries",
".",
"keys",
"(",
")",
")",
"+",
"1... | Update the `id_` counter so that it doesn't grow forever. | [
"Update",
"the",
"id_",
"counter",
"so",
"that",
"it",
"doesn",
"t",
"grow",
"forever",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/parser/directory_cache.py#L519-L526 |
3,209 | gccxml/pygccxml | pygccxml/parser/directory_cache.py | filename_repository_t._get_signature | def _get_signature(self, entry):
"""Return the signature of the file stored in entry.
"""
if self._sha1_sigs:
# return sha1 digest of the file content...
if not os.path.exists(entry.filename):
return None
try:
with open(entry.f... | python | def _get_signature(self, entry):
"""Return the signature of the file stored in entry.
"""
if self._sha1_sigs:
# return sha1 digest of the file content...
if not os.path.exists(entry.filename):
return None
try:
with open(entry.f... | [
"def",
"_get_signature",
"(",
"self",
",",
"entry",
")",
":",
"if",
"self",
".",
"_sha1_sigs",
":",
"# return sha1 digest of the file content...",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"entry",
".",
"filename",
")",
":",
"return",
"None",
"try"... | Return the signature of the file stored in entry. | [
"Return",
"the",
"signature",
"of",
"the",
"file",
"stored",
"in",
"entry",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/parser/directory_cache.py#L528-L548 |
3,210 | gccxml/pygccxml | pygccxml/declarations/type_traits_classes.py | is_union | def is_union(declaration):
"""
Returns True if declaration represents a C++ union
Args:
declaration (declaration_t): the declaration to be checked.
Returns:
bool: True if declaration represents a C++ union
"""
if not is_class(declaration):
return False
decl = class_... | python | def is_union(declaration):
"""
Returns True if declaration represents a C++ union
Args:
declaration (declaration_t): the declaration to be checked.
Returns:
bool: True if declaration represents a C++ union
"""
if not is_class(declaration):
return False
decl = class_... | [
"def",
"is_union",
"(",
"declaration",
")",
":",
"if",
"not",
"is_class",
"(",
"declaration",
")",
":",
"return",
"False",
"decl",
"=",
"class_traits",
".",
"get_declaration",
"(",
"declaration",
")",
"return",
"decl",
".",
"class_type",
"==",
"class_declarati... | Returns True if declaration represents a C++ union
Args:
declaration (declaration_t): the declaration to be checked.
Returns:
bool: True if declaration represents a C++ union | [
"Returns",
"True",
"if",
"declaration",
"represents",
"a",
"C",
"++",
"union"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/type_traits_classes.py#L18-L31 |
3,211 | gccxml/pygccxml | pygccxml/declarations/type_traits_classes.py | is_struct | def is_struct(declaration):
"""
Returns True if declaration represents a C++ struct
Args:
declaration (declaration_t): the declaration to be checked.
Returns:
bool: True if declaration represents a C++ struct
"""
if not is_class(declaration):
return False
decl = cla... | python | def is_struct(declaration):
"""
Returns True if declaration represents a C++ struct
Args:
declaration (declaration_t): the declaration to be checked.
Returns:
bool: True if declaration represents a C++ struct
"""
if not is_class(declaration):
return False
decl = cla... | [
"def",
"is_struct",
"(",
"declaration",
")",
":",
"if",
"not",
"is_class",
"(",
"declaration",
")",
":",
"return",
"False",
"decl",
"=",
"class_traits",
".",
"get_declaration",
"(",
"declaration",
")",
"return",
"decl",
".",
"class_type",
"==",
"class_declarat... | Returns True if declaration represents a C++ struct
Args:
declaration (declaration_t): the declaration to be checked.
Returns:
bool: True if declaration represents a C++ struct | [
"Returns",
"True",
"if",
"declaration",
"represents",
"a",
"C",
"++",
"struct"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/type_traits_classes.py#L34-L47 |
3,212 | gccxml/pygccxml | pygccxml/declarations/type_traits_classes.py | find_trivial_constructor | def find_trivial_constructor(type_):
"""
Returns reference to trivial constructor.
Args:
type_ (declarations.class_t): the class to be searched.
Returns:
declarations.constructor_t: the trivial constructor
"""
assert isinstance(type_, class_declaration.class_t)
trivial = ... | python | def find_trivial_constructor(type_):
"""
Returns reference to trivial constructor.
Args:
type_ (declarations.class_t): the class to be searched.
Returns:
declarations.constructor_t: the trivial constructor
"""
assert isinstance(type_, class_declaration.class_t)
trivial = ... | [
"def",
"find_trivial_constructor",
"(",
"type_",
")",
":",
"assert",
"isinstance",
"(",
"type_",
",",
"class_declaration",
".",
"class_t",
")",
"trivial",
"=",
"type_",
".",
"constructors",
"(",
"lambda",
"x",
":",
"is_trivial_constructor",
"(",
"x",
")",
",",... | Returns reference to trivial constructor.
Args:
type_ (declarations.class_t): the class to be searched.
Returns:
declarations.constructor_t: the trivial constructor | [
"Returns",
"reference",
"to",
"trivial",
"constructor",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/type_traits_classes.py#L111-L131 |
3,213 | gccxml/pygccxml | pygccxml/declarations/type_traits_classes.py | find_copy_constructor | def find_copy_constructor(type_):
"""
Returns reference to copy constructor.
Args:
type_ (declarations.class_t): the class to be searched.
Returns:
declarations.constructor_t: the copy constructor
"""
copy_ = type_.constructors(
lambda x: is_copy_constructor(x),
... | python | def find_copy_constructor(type_):
"""
Returns reference to copy constructor.
Args:
type_ (declarations.class_t): the class to be searched.
Returns:
declarations.constructor_t: the copy constructor
"""
copy_ = type_.constructors(
lambda x: is_copy_constructor(x),
... | [
"def",
"find_copy_constructor",
"(",
"type_",
")",
":",
"copy_",
"=",
"type_",
".",
"constructors",
"(",
"lambda",
"x",
":",
"is_copy_constructor",
"(",
"x",
")",
",",
"recursive",
"=",
"False",
",",
"allow_empty",
"=",
"True",
")",
"if",
"copy_",
":",
"... | Returns reference to copy constructor.
Args:
type_ (declarations.class_t): the class to be searched.
Returns:
declarations.constructor_t: the copy constructor | [
"Returns",
"reference",
"to",
"copy",
"constructor",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/type_traits_classes.py#L134-L152 |
3,214 | gccxml/pygccxml | pygccxml/declarations/type_traits_classes.py | find_noncopyable_vars | def find_noncopyable_vars(class_type, already_visited_cls_vars=None):
"""
Returns list of all `noncopyable` variables.
If an already_visited_cls_vars list is provided as argument, the returned
list will not contain these variables. This list will be extended with
whatever variables pointing to clas... | python | def find_noncopyable_vars(class_type, already_visited_cls_vars=None):
"""
Returns list of all `noncopyable` variables.
If an already_visited_cls_vars list is provided as argument, the returned
list will not contain these variables. This list will be extended with
whatever variables pointing to clas... | [
"def",
"find_noncopyable_vars",
"(",
"class_type",
",",
"already_visited_cls_vars",
"=",
"None",
")",
":",
"assert",
"isinstance",
"(",
"class_type",
",",
"class_declaration",
".",
"class_t",
")",
"logger",
"=",
"utils",
".",
"loggers",
".",
"cxx_parser",
"mvars",... | Returns list of all `noncopyable` variables.
If an already_visited_cls_vars list is provided as argument, the returned
list will not contain these variables. This list will be extended with
whatever variables pointing to classes have been found.
Args:
class_type (declarations.class_t): the cla... | [
"Returns",
"list",
"of",
"all",
"noncopyable",
"variables",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/type_traits_classes.py#L155-L228 |
3,215 | gccxml/pygccxml | pygccxml/declarations/type_traits_classes.py | has_trivial_constructor | def has_trivial_constructor(class_):
"""if class has public trivial constructor, this function will return
reference to it, None otherwise"""
class_ = class_traits.get_declaration(class_)
trivial = find_trivial_constructor(class_)
if trivial and trivial.access_type == 'public':
return trivia... | python | def has_trivial_constructor(class_):
"""if class has public trivial constructor, this function will return
reference to it, None otherwise"""
class_ = class_traits.get_declaration(class_)
trivial = find_trivial_constructor(class_)
if trivial and trivial.access_type == 'public':
return trivia... | [
"def",
"has_trivial_constructor",
"(",
"class_",
")",
":",
"class_",
"=",
"class_traits",
".",
"get_declaration",
"(",
"class_",
")",
"trivial",
"=",
"find_trivial_constructor",
"(",
"class_",
")",
"if",
"trivial",
"and",
"trivial",
".",
"access_type",
"==",
"'p... | if class has public trivial constructor, this function will return
reference to it, None otherwise | [
"if",
"class",
"has",
"public",
"trivial",
"constructor",
"this",
"function",
"will",
"return",
"reference",
"to",
"it",
"None",
"otherwise"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/type_traits_classes.py#L231-L237 |
3,216 | gccxml/pygccxml | pygccxml/declarations/type_traits_classes.py | has_copy_constructor | def has_copy_constructor(class_):
"""if class has public copy constructor, this function will return
reference to it, None otherwise"""
class_ = class_traits.get_declaration(class_)
copy_constructor = find_copy_constructor(class_)
if copy_constructor and copy_constructor.access_type == 'public':
... | python | def has_copy_constructor(class_):
"""if class has public copy constructor, this function will return
reference to it, None otherwise"""
class_ = class_traits.get_declaration(class_)
copy_constructor = find_copy_constructor(class_)
if copy_constructor and copy_constructor.access_type == 'public':
... | [
"def",
"has_copy_constructor",
"(",
"class_",
")",
":",
"class_",
"=",
"class_traits",
".",
"get_declaration",
"(",
"class_",
")",
"copy_constructor",
"=",
"find_copy_constructor",
"(",
"class_",
")",
"if",
"copy_constructor",
"and",
"copy_constructor",
".",
"access... | if class has public copy constructor, this function will return
reference to it, None otherwise | [
"if",
"class",
"has",
"public",
"copy",
"constructor",
"this",
"function",
"will",
"return",
"reference",
"to",
"it",
"None",
"otherwise"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/type_traits_classes.py#L240-L246 |
3,217 | gccxml/pygccxml | pygccxml/declarations/type_traits_classes.py | has_destructor | def has_destructor(class_):
"""if class has destructor, this function will return reference to it,
None otherwise"""
class_ = class_traits.get_declaration(class_)
destructor = class_.decls(
decl_type=calldef_members.destructor_t,
recursive=False,
allow_empty=True)
if destruct... | python | def has_destructor(class_):
"""if class has destructor, this function will return reference to it,
None otherwise"""
class_ = class_traits.get_declaration(class_)
destructor = class_.decls(
decl_type=calldef_members.destructor_t,
recursive=False,
allow_empty=True)
if destruct... | [
"def",
"has_destructor",
"(",
"class_",
")",
":",
"class_",
"=",
"class_traits",
".",
"get_declaration",
"(",
"class_",
")",
"destructor",
"=",
"class_",
".",
"decls",
"(",
"decl_type",
"=",
"calldef_members",
".",
"destructor_t",
",",
"recursive",
"=",
"False... | if class has destructor, this function will return reference to it,
None otherwise | [
"if",
"class",
"has",
"destructor",
"this",
"function",
"will",
"return",
"reference",
"to",
"it",
"None",
"otherwise"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/type_traits_classes.py#L249-L258 |
3,218 | gccxml/pygccxml | pygccxml/declarations/type_traits_classes.py | has_public_constructor | def has_public_constructor(class_):
"""if class has any public constructor, this function will return list of
them, otherwise None"""
class_ = class_traits.get_declaration(class_)
decls = class_.constructors(
lambda c: not is_copy_constructor(c) and c.access_type == 'public',
recursive=F... | python | def has_public_constructor(class_):
"""if class has any public constructor, this function will return list of
them, otherwise None"""
class_ = class_traits.get_declaration(class_)
decls = class_.constructors(
lambda c: not is_copy_constructor(c) and c.access_type == 'public',
recursive=F... | [
"def",
"has_public_constructor",
"(",
"class_",
")",
":",
"class_",
"=",
"class_traits",
".",
"get_declaration",
"(",
"class_",
")",
"decls",
"=",
"class_",
".",
"constructors",
"(",
"lambda",
"c",
":",
"not",
"is_copy_constructor",
"(",
"c",
")",
"and",
"c"... | if class has any public constructor, this function will return list of
them, otherwise None | [
"if",
"class",
"has",
"any",
"public",
"constructor",
"this",
"function",
"will",
"return",
"list",
"of",
"them",
"otherwise",
"None"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/type_traits_classes.py#L261-L270 |
3,219 | gccxml/pygccxml | pygccxml/declarations/type_traits_classes.py | has_public_assign | def has_public_assign(class_):
"""returns True, if class has public assign operator, False otherwise"""
class_ = class_traits.get_declaration(class_)
decls = class_.member_operators(
lambda o: o.symbol == '=' and o.access_type == 'public',
recursive=False,
allow_empty=True)
retur... | python | def has_public_assign(class_):
"""returns True, if class has public assign operator, False otherwise"""
class_ = class_traits.get_declaration(class_)
decls = class_.member_operators(
lambda o: o.symbol == '=' and o.access_type == 'public',
recursive=False,
allow_empty=True)
retur... | [
"def",
"has_public_assign",
"(",
"class_",
")",
":",
"class_",
"=",
"class_traits",
".",
"get_declaration",
"(",
"class_",
")",
"decls",
"=",
"class_",
".",
"member_operators",
"(",
"lambda",
"o",
":",
"o",
".",
"symbol",
"==",
"'='",
"and",
"o",
".",
"a... | returns True, if class has public assign operator, False otherwise | [
"returns",
"True",
"if",
"class",
"has",
"public",
"assign",
"operator",
"False",
"otherwise"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/type_traits_classes.py#L273-L280 |
3,220 | gccxml/pygccxml | pygccxml/declarations/type_traits_classes.py | has_vtable | def has_vtable(decl_type):
"""True, if class has virtual table, False otherwise"""
assert isinstance(decl_type, class_declaration.class_t)
return bool(
decl_type.calldefs(
lambda f: isinstance(f, calldef_members.member_function_t) and
f.virtuality != calldef_types.VIRTUALITY_... | python | def has_vtable(decl_type):
"""True, if class has virtual table, False otherwise"""
assert isinstance(decl_type, class_declaration.class_t)
return bool(
decl_type.calldefs(
lambda f: isinstance(f, calldef_members.member_function_t) and
f.virtuality != calldef_types.VIRTUALITY_... | [
"def",
"has_vtable",
"(",
"decl_type",
")",
":",
"assert",
"isinstance",
"(",
"decl_type",
",",
"class_declaration",
".",
"class_t",
")",
"return",
"bool",
"(",
"decl_type",
".",
"calldefs",
"(",
"lambda",
"f",
":",
"isinstance",
"(",
"f",
",",
"calldef_memb... | True, if class has virtual table, False otherwise | [
"True",
"if",
"class",
"has",
"virtual",
"table",
"False",
"otherwise"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/type_traits_classes.py#L289-L297 |
3,221 | gccxml/pygccxml | pygccxml/declarations/type_traits_classes.py | is_base_and_derived | def is_base_and_derived(based, derived):
"""returns True, if there is "base and derived" relationship between
classes, False otherwise"""
assert isinstance(based, class_declaration.class_t)
assert isinstance(derived, (class_declaration.class_t, tuple))
if isinstance(derived, class_declaration.class... | python | def is_base_and_derived(based, derived):
"""returns True, if there is "base and derived" relationship between
classes, False otherwise"""
assert isinstance(based, class_declaration.class_t)
assert isinstance(derived, (class_declaration.class_t, tuple))
if isinstance(derived, class_declaration.class... | [
"def",
"is_base_and_derived",
"(",
"based",
",",
"derived",
")",
":",
"assert",
"isinstance",
"(",
"based",
",",
"class_declaration",
".",
"class_t",
")",
"assert",
"isinstance",
"(",
"derived",
",",
"(",
"class_declaration",
".",
"class_t",
",",
"tuple",
")",... | returns True, if there is "base and derived" relationship between
classes, False otherwise | [
"returns",
"True",
"if",
"there",
"is",
"base",
"and",
"derived",
"relationship",
"between",
"classes",
"False",
"otherwise"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/type_traits_classes.py#L300-L315 |
3,222 | gccxml/pygccxml | pygccxml/declarations/type_traits_classes.py | is_noncopyable | def is_noncopyable(class_, already_visited_cls_vars=None):
"""
Checks if class is non copyable
Args:
class_ (declarations.class_t): the class to be checked
already_visited_cls_vars (list): optional list of vars that should not
be checked a second time, to prevent infinite recurs... | python | def is_noncopyable(class_, already_visited_cls_vars=None):
"""
Checks if class is non copyable
Args:
class_ (declarations.class_t): the class to be checked
already_visited_cls_vars (list): optional list of vars that should not
be checked a second time, to prevent infinite recurs... | [
"def",
"is_noncopyable",
"(",
"class_",
",",
"already_visited_cls_vars",
"=",
"None",
")",
":",
"logger",
"=",
"utils",
".",
"loggers",
".",
"cxx_parser",
"class_decl",
"=",
"class_traits",
".",
"get_declaration",
"(",
"class_",
")",
"true_header",
"=",
"\"is_no... | Checks if class is non copyable
Args:
class_ (declarations.class_t): the class to be checked
already_visited_cls_vars (list): optional list of vars that should not
be checked a second time, to prevent infinite recursions.
In general you can ignore this argument, it is mainly... | [
"Checks",
"if",
"class",
"is",
"non",
"copyable"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/type_traits_classes.py#L708-L785 |
3,223 | gccxml/pygccxml | pygccxml/declarations/type_traits_classes.py | is_unary_operator | def is_unary_operator(oper):
"""returns True, if operator is unary operator, otherwise False"""
# definition:
# member in class
# ret-type operator symbol()
# ret-type operator [++ --](int)
# globally
# ret-type operator symbol( arg )
# ret-type operator [++ --](X&, int)
symbols = ['... | python | def is_unary_operator(oper):
"""returns True, if operator is unary operator, otherwise False"""
# definition:
# member in class
# ret-type operator symbol()
# ret-type operator [++ --](int)
# globally
# ret-type operator symbol( arg )
# ret-type operator [++ --](X&, int)
symbols = ['... | [
"def",
"is_unary_operator",
"(",
"oper",
")",
":",
"# definition:",
"# member in class",
"# ret-type operator symbol()",
"# ret-type operator [++ --](int)",
"# globally",
"# ret-type operator symbol( arg )",
"# ret-type operator [++ --](X&, int)",
"symbols",
"=",
"[",
"'!'",
",",
... | returns True, if operator is unary operator, otherwise False | [
"returns",
"True",
"if",
"operator",
"is",
"unary",
"operator",
"otherwise",
"False"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/type_traits_classes.py#L788-L818 |
3,224 | gccxml/pygccxml | pygccxml/declarations/type_traits_classes.py | is_binary_operator | def is_binary_operator(oper):
"""returns True, if operator is binary operator, otherwise False"""
# definition:
# member in class
# ret-type operator symbol(arg)
# globally
# ret-type operator symbol( arg1, arg2 )
symbols = [
',', '()', '[]', '!=', '%', '%=', '&', '&&', '&=', '*', '*... | python | def is_binary_operator(oper):
"""returns True, if operator is binary operator, otherwise False"""
# definition:
# member in class
# ret-type operator symbol(arg)
# globally
# ret-type operator symbol( arg1, arg2 )
symbols = [
',', '()', '[]', '!=', '%', '%=', '&', '&&', '&=', '*', '*... | [
"def",
"is_binary_operator",
"(",
"oper",
")",
":",
"# definition:",
"# member in class",
"# ret-type operator symbol(arg)",
"# globally",
"# ret-type operator symbol( arg1, arg2 )",
"symbols",
"=",
"[",
"','",
",",
"'()'",
",",
"'[]'",
",",
"'!='",
",",
"'%'",
",",
"... | returns True, if operator is binary operator, otherwise False | [
"returns",
"True",
"if",
"operator",
"is",
"binary",
"operator",
"otherwise",
"False"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/type_traits_classes.py#L821-L844 |
3,225 | gccxml/pygccxml | pygccxml/declarations/type_traits_classes.py | is_copy_constructor | def is_copy_constructor(constructor):
"""
Check if the declaration is a copy constructor,
Args:
constructor (declarations.constructor_t): the constructor
to be checked.
Returns:
bool: True if this is a copy constructor, False instead.
"""
assert isinstance(construc... | python | def is_copy_constructor(constructor):
"""
Check if the declaration is a copy constructor,
Args:
constructor (declarations.constructor_t): the constructor
to be checked.
Returns:
bool: True if this is a copy constructor, False instead.
"""
assert isinstance(construc... | [
"def",
"is_copy_constructor",
"(",
"constructor",
")",
":",
"assert",
"isinstance",
"(",
"constructor",
",",
"calldef_members",
".",
"constructor_t",
")",
"args",
"=",
"constructor",
".",
"arguments",
"parent",
"=",
"constructor",
".",
"parent",
"# A copy constructo... | Check if the declaration is a copy constructor,
Args:
constructor (declarations.constructor_t): the constructor
to be checked.
Returns:
bool: True if this is a copy constructor, False instead. | [
"Check",
"if",
"the",
"declaration",
"is",
"a",
"copy",
"constructor"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/type_traits_classes.py#L847-L900 |
3,226 | gccxml/pygccxml | pygccxml/declarations/class_declaration.py | class_t.get_members | def get_members(self, access=None):
"""
returns list of members according to access type
If access equals to None, then returned list will contain all members.
You should not modify the list content, otherwise different
optimization data will stop work and may to give you wrong ... | python | def get_members(self, access=None):
"""
returns list of members according to access type
If access equals to None, then returned list will contain all members.
You should not modify the list content, otherwise different
optimization data will stop work and may to give you wrong ... | [
"def",
"get_members",
"(",
"self",
",",
"access",
"=",
"None",
")",
":",
"if",
"access",
"==",
"ACCESS_TYPES",
".",
"PUBLIC",
":",
"return",
"self",
".",
"public_members",
"elif",
"access",
"==",
"ACCESS_TYPES",
".",
"PROTECTED",
":",
"return",
"self",
"."... | returns list of members according to access type
If access equals to None, then returned list will contain all members.
You should not modify the list content, otherwise different
optimization data will stop work and may to give you wrong results.
:param access: describes desired membe... | [
"returns",
"list",
"of",
"members",
"according",
"to",
"access",
"type"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/class_declaration.py#L363-L387 |
3,227 | gccxml/pygccxml | pygccxml/declarations/class_declaration.py | class_t.adopt_declaration | def adopt_declaration(self, decl, access):
"""adds new declaration to the class
:param decl: reference to a :class:`declaration_t`
:param access: member access type
:type access: :class:ACCESS_TYPES
"""
if access == ACCESS_TYPES.PUBLIC:
self.public_members.a... | python | def adopt_declaration(self, decl, access):
"""adds new declaration to the class
:param decl: reference to a :class:`declaration_t`
:param access: member access type
:type access: :class:ACCESS_TYPES
"""
if access == ACCESS_TYPES.PUBLIC:
self.public_members.a... | [
"def",
"adopt_declaration",
"(",
"self",
",",
"decl",
",",
"access",
")",
":",
"if",
"access",
"==",
"ACCESS_TYPES",
".",
"PUBLIC",
":",
"self",
".",
"public_members",
".",
"append",
"(",
"decl",
")",
"elif",
"access",
"==",
"ACCESS_TYPES",
".",
"PROTECTED... | adds new declaration to the class
:param decl: reference to a :class:`declaration_t`
:param access: member access type
:type access: :class:ACCESS_TYPES | [
"adds",
"new",
"declaration",
"to",
"the",
"class"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/class_declaration.py#L389-L407 |
3,228 | gccxml/pygccxml | pygccxml/declarations/class_declaration.py | class_t.remove_declaration | def remove_declaration(self, decl):
"""
removes decl from members list
:param decl: declaration to be removed
:type decl: :class:`declaration_t`
"""
access_type = self.find_out_member_access_type(decl)
if access_type == ACCESS_TYPES.PUBLIC:
containe... | python | def remove_declaration(self, decl):
"""
removes decl from members list
:param decl: declaration to be removed
:type decl: :class:`declaration_t`
"""
access_type = self.find_out_member_access_type(decl)
if access_type == ACCESS_TYPES.PUBLIC:
containe... | [
"def",
"remove_declaration",
"(",
"self",
",",
"decl",
")",
":",
"access_type",
"=",
"self",
".",
"find_out_member_access_type",
"(",
"decl",
")",
"if",
"access_type",
"==",
"ACCESS_TYPES",
".",
"PUBLIC",
":",
"container",
"=",
"self",
".",
"public_members",
"... | removes decl from members list
:param decl: declaration to be removed
:type decl: :class:`declaration_t` | [
"removes",
"decl",
"from",
"members",
"list"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/class_declaration.py#L409-L425 |
3,229 | gccxml/pygccxml | pygccxml/declarations/class_declaration.py | class_t.find_out_member_access_type | def find_out_member_access_type(self, member):
"""
returns member access type
:param member: member of the class
:type member: :class:`declaration_t`
:rtype: :class:ACCESS_TYPES
"""
assert member.parent is self
if not member.cache.access_type:
... | python | def find_out_member_access_type(self, member):
"""
returns member access type
:param member: member of the class
:type member: :class:`declaration_t`
:rtype: :class:ACCESS_TYPES
"""
assert member.parent is self
if not member.cache.access_type:
... | [
"def",
"find_out_member_access_type",
"(",
"self",
",",
"member",
")",
":",
"assert",
"member",
".",
"parent",
"is",
"self",
"if",
"not",
"member",
".",
"cache",
".",
"access_type",
":",
"if",
"member",
"in",
"self",
".",
"public_members",
":",
"access_type"... | returns member access type
:param member: member of the class
:type member: :class:`declaration_t`
:rtype: :class:ACCESS_TYPES | [
"returns",
"member",
"access",
"type"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/class_declaration.py#L427-L450 |
3,230 | gccxml/pygccxml | pygccxml/declarations/class_declaration.py | class_t.top_class | def top_class(self):
"""reference to a parent class, which contains this class and defined
within a namespace
if this class is defined under a namespace, self will be returned"""
curr = self
parent = self.parent
while isinstance(parent, class_t):
curr = paren... | python | def top_class(self):
"""reference to a parent class, which contains this class and defined
within a namespace
if this class is defined under a namespace, self will be returned"""
curr = self
parent = self.parent
while isinstance(parent, class_t):
curr = paren... | [
"def",
"top_class",
"(",
"self",
")",
":",
"curr",
"=",
"self",
"parent",
"=",
"self",
".",
"parent",
"while",
"isinstance",
"(",
"parent",
",",
"class_t",
")",
":",
"curr",
"=",
"parent",
"parent",
"=",
"parent",
".",
"parent",
"return",
"curr"
] | reference to a parent class, which contains this class and defined
within a namespace
if this class is defined under a namespace, self will be returned | [
"reference",
"to",
"a",
"parent",
"class",
"which",
"contains",
"this",
"class",
"and",
"defined",
"within",
"a",
"namespace"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/class_declaration.py#L494-L504 |
3,231 | gccxml/pygccxml | pygccxml/declarations/enumeration.py | enumeration_t.append_value | def append_value(self, valuename, valuenum=None):
"""Append another enumeration value to the `enum`.
The numeric value may be None in which case it is automatically
determined by increasing the value of the last item.
When the 'values' attribute is accessed the resulting list will be i... | python | def append_value(self, valuename, valuenum=None):
"""Append another enumeration value to the `enum`.
The numeric value may be None in which case it is automatically
determined by increasing the value of the last item.
When the 'values' attribute is accessed the resulting list will be i... | [
"def",
"append_value",
"(",
"self",
",",
"valuename",
",",
"valuenum",
"=",
"None",
")",
":",
"# No number given? Then use the previous one + 1",
"if",
"valuenum",
"is",
"None",
":",
"if",
"not",
"self",
".",
"_values",
":",
"valuenum",
"=",
"0",
"else",
":",
... | Append another enumeration value to the `enum`.
The numeric value may be None in which case it is automatically
determined by increasing the value of the last item.
When the 'values' attribute is accessed the resulting list will be in
the same order as append_value() was called.
... | [
"Append",
"another",
"enumeration",
"value",
"to",
"the",
"enum",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/enumeration.py#L92-L114 |
3,232 | gccxml/pygccxml | pygccxml/declarations/enumeration.py | enumeration_t.has_value_name | def has_value_name(self, name):
"""Check if this `enum` has a particular name among its values.
:param name: Enumeration value name
:type name: str
:rtype: True if there is an enumeration value with the given name
"""
for val, _ in self._values:
if val == nam... | python | def has_value_name(self, name):
"""Check if this `enum` has a particular name among its values.
:param name: Enumeration value name
:type name: str
:rtype: True if there is an enumeration value with the given name
"""
for val, _ in self._values:
if val == nam... | [
"def",
"has_value_name",
"(",
"self",
",",
"name",
")",
":",
"for",
"val",
",",
"_",
"in",
"self",
".",
"_values",
":",
"if",
"val",
"==",
"name",
":",
"return",
"True",
"return",
"False"
] | Check if this `enum` has a particular name among its values.
:param name: Enumeration value name
:type name: str
:rtype: True if there is an enumeration value with the given name | [
"Check",
"if",
"this",
"enum",
"has",
"a",
"particular",
"name",
"among",
"its",
"values",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/enumeration.py#L116-L126 |
3,233 | gccxml/pygccxml | pygccxml/parser/patcher.py | update_unnamed_class | def update_unnamed_class(decls):
"""
Adds name to class_t declarations.
If CastXML is being used, the type definitions with an unnamed
class/struct are split across two nodes in the XML tree. For example,
typedef struct {} cls;
produces
<Struct id="_7" name="" context="_1" .../>
... | python | def update_unnamed_class(decls):
"""
Adds name to class_t declarations.
If CastXML is being used, the type definitions with an unnamed
class/struct are split across two nodes in the XML tree. For example,
typedef struct {} cls;
produces
<Struct id="_7" name="" context="_1" .../>
... | [
"def",
"update_unnamed_class",
"(",
"decls",
")",
":",
"for",
"decl",
"in",
"decls",
":",
"if",
"isinstance",
"(",
"decl",
",",
"declarations",
".",
"typedef_t",
")",
":",
"referent",
"=",
"decl",
".",
"decl_type",
"if",
"isinstance",
"(",
"referent",
",",... | Adds name to class_t declarations.
If CastXML is being used, the type definitions with an unnamed
class/struct are split across two nodes in the XML tree. For example,
typedef struct {} cls;
produces
<Struct id="_7" name="" context="_1" .../>
<Typedef id="_8" name="cls" type="_7"... | [
"Adds",
"name",
"to",
"class_t",
"declarations",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/parser/patcher.py#L266-L305 |
3,234 | gccxml/pygccxml | pygccxml/parser/project_reader.py | project_reader_t.get_os_file_names | def get_os_file_names(files):
"""
returns file names
:param files: list of strings and\\or :class:`file_configuration_t`
instances.
:type files: list
"""
fnames = []
for f in files:
if utils.is_str(f):
fnames.app... | python | def get_os_file_names(files):
"""
returns file names
:param files: list of strings and\\or :class:`file_configuration_t`
instances.
:type files: list
"""
fnames = []
for f in files:
if utils.is_str(f):
fnames.app... | [
"def",
"get_os_file_names",
"(",
"files",
")",
":",
"fnames",
"=",
"[",
"]",
"for",
"f",
"in",
"files",
":",
"if",
"utils",
".",
"is_str",
"(",
"f",
")",
":",
"fnames",
".",
"append",
"(",
"f",
")",
"elif",
"isinstance",
"(",
"f",
",",
"file_config... | returns file names
:param files: list of strings and\\or :class:`file_configuration_t`
instances.
:type files: list | [
"returns",
"file",
"names"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/parser/project_reader.py#L213-L234 |
3,235 | gccxml/pygccxml | pygccxml/parser/project_reader.py | project_reader_t.read_files | def read_files(
self,
files,
compilation_mode=COMPILATION_MODE.FILE_BY_FILE):
"""
parses a set of files
:param files: list of strings and\\or :class:`file_configuration_t`
instances.
:type files: list
:param compilation_... | python | def read_files(
self,
files,
compilation_mode=COMPILATION_MODE.FILE_BY_FILE):
"""
parses a set of files
:param files: list of strings and\\or :class:`file_configuration_t`
instances.
:type files: list
:param compilation_... | [
"def",
"read_files",
"(",
"self",
",",
"files",
",",
"compilation_mode",
"=",
"COMPILATION_MODE",
".",
"FILE_BY_FILE",
")",
":",
"if",
"compilation_mode",
"==",
"COMPILATION_MODE",
".",
"ALL_AT_ONCE",
"and",
"len",
"(",
"files",
")",
"==",
"len",
"(",
"self",
... | parses a set of files
:param files: list of strings and\\or :class:`file_configuration_t`
instances.
:type files: list
:param compilation_mode: determines whether the files are parsed
individually or as one single chunk
:type compi... | [
"parses",
"a",
"set",
"of",
"files"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/parser/project_reader.py#L236-L264 |
3,236 | gccxml/pygccxml | pygccxml/parser/project_reader.py | project_reader_t.read_xml | def read_xml(self, file_configuration):
"""parses C++ code, defined on the file_configurations and returns
GCCXML generated file content"""
xml_file_path = None
delete_xml_file = True
fc = file_configuration
reader = source_reader.source_reader_t(
self.__conf... | python | def read_xml(self, file_configuration):
"""parses C++ code, defined on the file_configurations and returns
GCCXML generated file content"""
xml_file_path = None
delete_xml_file = True
fc = file_configuration
reader = source_reader.source_reader_t(
self.__conf... | [
"def",
"read_xml",
"(",
"self",
",",
"file_configuration",
")",
":",
"xml_file_path",
"=",
"None",
"delete_xml_file",
"=",
"True",
"fc",
"=",
"file_configuration",
"reader",
"=",
"source_reader",
".",
"source_reader_t",
"(",
"self",
".",
"__config",
",",
"None",... | parses C++ code, defined on the file_configurations and returns
GCCXML generated file content | [
"parses",
"C",
"++",
"code",
"defined",
"on",
"the",
"file_configurations",
"and",
"returns",
"GCCXML",
"generated",
"file",
"content"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/parser/project_reader.py#L373-L417 |
3,237 | gccxml/pygccxml | pygccxml/declarations/dependencies.py | get_dependencies_from_decl | def get_dependencies_from_decl(decl, recursive=True):
"""
Returns the list of all types and declarations the declaration depends on.
"""
result = []
if isinstance(decl, typedef.typedef_t) or \
isinstance(decl, variable.variable_t):
return [dependency_info_t(decl, decl.decl_type)... | python | def get_dependencies_from_decl(decl, recursive=True):
"""
Returns the list of all types and declarations the declaration depends on.
"""
result = []
if isinstance(decl, typedef.typedef_t) or \
isinstance(decl, variable.variable_t):
return [dependency_info_t(decl, decl.decl_type)... | [
"def",
"get_dependencies_from_decl",
"(",
"decl",
",",
"recursive",
"=",
"True",
")",
":",
"result",
"=",
"[",
"]",
"if",
"isinstance",
"(",
"decl",
",",
"typedef",
".",
"typedef_t",
")",
"or",
"isinstance",
"(",
"decl",
",",
"variable",
".",
"variable_t",... | Returns the list of all types and declarations the declaration depends on. | [
"Returns",
"the",
"list",
"of",
"all",
"types",
"and",
"declarations",
"the",
"declaration",
"depends",
"on",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/dependencies.py#L16-L53 |
3,238 | gccxml/pygccxml | pygccxml/declarations/container_traits.py | find_container_traits | def find_container_traits(cls_or_string):
"""
Find the container traits type of a declaration.
Args:
cls_or_string (str | declarations.declaration_t): a string
Returns:
declarations.container_traits: a container traits
"""
if utils.is_str(cls_or_string):
if not templat... | python | def find_container_traits(cls_or_string):
"""
Find the container traits type of a declaration.
Args:
cls_or_string (str | declarations.declaration_t): a string
Returns:
declarations.container_traits: a container traits
"""
if utils.is_str(cls_or_string):
if not templat... | [
"def",
"find_container_traits",
"(",
"cls_or_string",
")",
":",
"if",
"utils",
".",
"is_str",
"(",
"cls_or_string",
")",
":",
"if",
"not",
"templates",
".",
"is_instantiation",
"(",
"cls_or_string",
")",
":",
"return",
"None",
"name",
"=",
"templates",
".",
... | Find the container traits type of a declaration.
Args:
cls_or_string (str | declarations.declaration_t): a string
Returns:
declarations.container_traits: a container traits | [
"Find",
"the",
"container",
"traits",
"type",
"of",
"a",
"declaration",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/container_traits.py#L697-L732 |
3,239 | gccxml/pygccxml | pygccxml/declarations/container_traits.py | container_traits_impl_t.get_container_or_none | def get_container_or_none(self, type_):
"""
Returns reference to the class declaration or None.
"""
type_ = type_traits.remove_alias(type_)
type_ = type_traits.remove_cv(type_)
utils.loggers.queries_engine.debug(
"Container traits: cleaned up search %s", ty... | python | def get_container_or_none(self, type_):
"""
Returns reference to the class declaration or None.
"""
type_ = type_traits.remove_alias(type_)
type_ = type_traits.remove_cv(type_)
utils.loggers.queries_engine.debug(
"Container traits: cleaned up search %s", ty... | [
"def",
"get_container_or_none",
"(",
"self",
",",
"type_",
")",
":",
"type_",
"=",
"type_traits",
".",
"remove_alias",
"(",
"type_",
")",
"type_",
"=",
"type_traits",
".",
"remove_cv",
"(",
"type_",
")",
"utils",
".",
"loggers",
".",
"queries_engine",
".",
... | Returns reference to the class declaration or None. | [
"Returns",
"reference",
"to",
"the",
"class",
"declaration",
"or",
"None",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/container_traits.py#L375-L430 |
3,240 | gccxml/pygccxml | pygccxml/declarations/container_traits.py | container_traits_impl_t.class_declaration | def class_declaration(self, type_):
"""
Returns reference to the class declaration.
"""
utils.loggers.queries_engine.debug(
"Container traits: searching class declaration for %s", type_)
cls_declaration = self.get_container_or_none(type_)
if not cls_declara... | python | def class_declaration(self, type_):
"""
Returns reference to the class declaration.
"""
utils.loggers.queries_engine.debug(
"Container traits: searching class declaration for %s", type_)
cls_declaration = self.get_container_or_none(type_)
if not cls_declara... | [
"def",
"class_declaration",
"(",
"self",
",",
"type_",
")",
":",
"utils",
".",
"loggers",
".",
"queries_engine",
".",
"debug",
"(",
"\"Container traits: searching class declaration for %s\"",
",",
"type_",
")",
"cls_declaration",
"=",
"self",
".",
"get_container_or_no... | Returns reference to the class declaration. | [
"Returns",
"reference",
"to",
"the",
"class",
"declaration",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/container_traits.py#L440-L454 |
3,241 | gccxml/pygccxml | pygccxml/declarations/container_traits.py | container_traits_impl_t.element_type | def element_type(self, type_):
"""returns reference to the class value\\mapped type declaration"""
return self.__find_xxx_type(
type_,
self.element_type_index,
self.element_type_typedef,
'container_element_type') | python | def element_type(self, type_):
"""returns reference to the class value\\mapped type declaration"""
return self.__find_xxx_type(
type_,
self.element_type_index,
self.element_type_typedef,
'container_element_type') | [
"def",
"element_type",
"(",
"self",
",",
"type_",
")",
":",
"return",
"self",
".",
"__find_xxx_type",
"(",
"type_",
",",
"self",
".",
"element_type_index",
",",
"self",
".",
"element_type_typedef",
",",
"'container_element_type'",
")"
] | returns reference to the class value\\mapped type declaration | [
"returns",
"reference",
"to",
"the",
"class",
"value",
"\\\\",
"mapped",
"type",
"declaration"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/container_traits.py#L488-L494 |
3,242 | gccxml/pygccxml | pygccxml/declarations/container_traits.py | container_traits_impl_t.key_type | def key_type(self, type_):
"""returns reference to the class key type declaration"""
if not self.is_mapping(type_):
raise TypeError(
'Type "%s" is not "mapping" container' %
str(type_))
return self.__find_xxx_type(
type_,
self.k... | python | def key_type(self, type_):
"""returns reference to the class key type declaration"""
if not self.is_mapping(type_):
raise TypeError(
'Type "%s" is not "mapping" container' %
str(type_))
return self.__find_xxx_type(
type_,
self.k... | [
"def",
"key_type",
"(",
"self",
",",
"type_",
")",
":",
"if",
"not",
"self",
".",
"is_mapping",
"(",
"type_",
")",
":",
"raise",
"TypeError",
"(",
"'Type \"%s\" is not \"mapping\" container'",
"%",
"str",
"(",
"type_",
")",
")",
"return",
"self",
".",
"__f... | returns reference to the class key type declaration | [
"returns",
"reference",
"to",
"the",
"class",
"key",
"type",
"declaration"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/container_traits.py#L496-L506 |
3,243 | gccxml/pygccxml | pygccxml/declarations/container_traits.py | container_traits_impl_t.remove_defaults | def remove_defaults(self, type_or_string):
"""
Removes template defaults from a templated class instantiation.
For example:
.. code-block:: c++
std::vector< int, std::allocator< int > >
will become:
.. code-block:: c++
std::vector... | python | def remove_defaults(self, type_or_string):
"""
Removes template defaults from a templated class instantiation.
For example:
.. code-block:: c++
std::vector< int, std::allocator< int > >
will become:
.. code-block:: c++
std::vector... | [
"def",
"remove_defaults",
"(",
"self",
",",
"type_or_string",
")",
":",
"name",
"=",
"type_or_string",
"if",
"not",
"utils",
".",
"is_str",
"(",
"type_or_string",
")",
":",
"name",
"=",
"self",
".",
"class_declaration",
"(",
"type_or_string",
")",
".",
"name... | Removes template defaults from a templated class instantiation.
For example:
.. code-block:: c++
std::vector< int, std::allocator< int > >
will become:
.. code-block:: c++
std::vector< int > | [
"Removes",
"template",
"defaults",
"from",
"a",
"templated",
"class",
"instantiation",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/container_traits.py#L508-L532 |
3,244 | gccxml/pygccxml | pygccxml/declarations/namespace.py | namespace_t.take_parenting | def take_parenting(self, inst):
"""
Takes parenting from inst and transfers it to self.
Args:
inst (namespace_t): a namespace declaration
"""
if self is inst:
return
for decl in inst.declarations:
decl.parent = self
self.... | python | def take_parenting(self, inst):
"""
Takes parenting from inst and transfers it to self.
Args:
inst (namespace_t): a namespace declaration
"""
if self is inst:
return
for decl in inst.declarations:
decl.parent = self
self.... | [
"def",
"take_parenting",
"(",
"self",
",",
"inst",
")",
":",
"if",
"self",
"is",
"inst",
":",
"return",
"for",
"decl",
"in",
"inst",
".",
"declarations",
":",
"decl",
".",
"parent",
"=",
"self",
"self",
".",
"declarations",
".",
"append",
"(",
"decl",
... | Takes parenting from inst and transfers it to self.
Args:
inst (namespace_t): a namespace declaration | [
"Takes",
"parenting",
"from",
"inst",
"and",
"transfers",
"it",
"to",
"self",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/namespace.py#L73-L87 |
3,245 | gccxml/pygccxml | pygccxml/declarations/namespace.py | namespace_t.remove_declaration | def remove_declaration(self, decl):
"""
Removes declaration from members list.
:param decl: declaration to be removed
:type decl: :class:`declaration_t`
"""
del self.declarations[self.declarations.index(decl)]
decl.cache.reset() | python | def remove_declaration(self, decl):
"""
Removes declaration from members list.
:param decl: declaration to be removed
:type decl: :class:`declaration_t`
"""
del self.declarations[self.declarations.index(decl)]
decl.cache.reset() | [
"def",
"remove_declaration",
"(",
"self",
",",
"decl",
")",
":",
"del",
"self",
".",
"declarations",
"[",
"self",
".",
"declarations",
".",
"index",
"(",
"decl",
")",
"]",
"decl",
".",
"cache",
".",
"reset",
"(",
")"
] | Removes declaration from members list.
:param decl: declaration to be removed
:type decl: :class:`declaration_t` | [
"Removes",
"declaration",
"from",
"members",
"list",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/namespace.py#L94-L104 |
3,246 | gccxml/pygccxml | pygccxml/declarations/namespace.py | namespace_t.namespace | def namespace(self, name=None, function=None, recursive=None):
"""
Returns reference to namespace declaration that matches
a defined criteria.
"""
return (
self._find_single(
scopedef.scopedef_t._impl_matchers[namespace_t.namespace],
... | python | def namespace(self, name=None, function=None, recursive=None):
"""
Returns reference to namespace declaration that matches
a defined criteria.
"""
return (
self._find_single(
scopedef.scopedef_t._impl_matchers[namespace_t.namespace],
... | [
"def",
"namespace",
"(",
"self",
",",
"name",
"=",
"None",
",",
"function",
"=",
"None",
",",
"recursive",
"=",
"None",
")",
":",
"return",
"(",
"self",
".",
"_find_single",
"(",
"scopedef",
".",
"scopedef_t",
".",
"_impl_matchers",
"[",
"namespace_t",
"... | Returns reference to namespace declaration that matches
a defined criteria. | [
"Returns",
"reference",
"to",
"namespace",
"declaration",
"that",
"matches",
"a",
"defined",
"criteria",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/namespace.py#L109-L122 |
3,247 | gccxml/pygccxml | pygccxml/declarations/namespace.py | namespace_t.namespaces | def namespaces(
self,
name=None,
function=None,
recursive=None,
allow_empty=None):
"""
Returns a set of namespace declarations that match
a defined criteria.
"""
return (
self._find_multiple(
... | python | def namespaces(
self,
name=None,
function=None,
recursive=None,
allow_empty=None):
"""
Returns a set of namespace declarations that match
a defined criteria.
"""
return (
self._find_multiple(
... | [
"def",
"namespaces",
"(",
"self",
",",
"name",
"=",
"None",
",",
"function",
"=",
"None",
",",
"recursive",
"=",
"None",
",",
"allow_empty",
"=",
"None",
")",
":",
"return",
"(",
"self",
".",
"_find_multiple",
"(",
"scopedef",
".",
"scopedef_t",
".",
"... | Returns a set of namespace declarations that match
a defined criteria. | [
"Returns",
"a",
"set",
"of",
"namespace",
"declarations",
"that",
"match",
"a",
"defined",
"criteria",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/namespace.py#L124-L143 |
3,248 | gccxml/pygccxml | pygccxml/declarations/namespace.py | namespace_t.free_function | def free_function(
self,
name=None,
function=None,
return_type=None,
arg_types=None,
header_dir=None,
header_file=None,
recursive=None):
"""
Returns reference to free function declaration that matches
... | python | def free_function(
self,
name=None,
function=None,
return_type=None,
arg_types=None,
header_dir=None,
header_file=None,
recursive=None):
"""
Returns reference to free function declaration that matches
... | [
"def",
"free_function",
"(",
"self",
",",
"name",
"=",
"None",
",",
"function",
"=",
"None",
",",
"return_type",
"=",
"None",
",",
"arg_types",
"=",
"None",
",",
"header_dir",
"=",
"None",
",",
"header_file",
"=",
"None",
",",
"recursive",
"=",
"None",
... | Returns reference to free function declaration that matches
a defined criteria. | [
"Returns",
"reference",
"to",
"free",
"function",
"declaration",
"that",
"matches",
"a",
"defined",
"criteria",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/namespace.py#L145-L171 |
3,249 | gccxml/pygccxml | pygccxml/declarations/namespace.py | namespace_t.free_functions | def free_functions(
self,
name=None,
function=None,
return_type=None,
arg_types=None,
header_dir=None,
header_file=None,
recursive=None,
allow_empty=None):
"""
Returns a set of free function decla... | python | def free_functions(
self,
name=None,
function=None,
return_type=None,
arg_types=None,
header_dir=None,
header_file=None,
recursive=None,
allow_empty=None):
"""
Returns a set of free function decla... | [
"def",
"free_functions",
"(",
"self",
",",
"name",
"=",
"None",
",",
"function",
"=",
"None",
",",
"return_type",
"=",
"None",
",",
"arg_types",
"=",
"None",
",",
"header_dir",
"=",
"None",
",",
"header_file",
"=",
"None",
",",
"recursive",
"=",
"None",
... | Returns a set of free function declarations that match
a defined criteria. | [
"Returns",
"a",
"set",
"of",
"free",
"function",
"declarations",
"that",
"match",
"a",
"defined",
"criteria",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/namespace.py#L173-L201 |
3,250 | gccxml/pygccxml | pygccxml/declarations/namespace.py | namespace_t.free_operator | def free_operator(
self,
name=None,
function=None,
symbol=None,
return_type=None,
arg_types=None,
header_dir=None,
header_file=None,
recursive=None):
"""
Returns reference to free operator declara... | python | def free_operator(
self,
name=None,
function=None,
symbol=None,
return_type=None,
arg_types=None,
header_dir=None,
header_file=None,
recursive=None):
"""
Returns reference to free operator declara... | [
"def",
"free_operator",
"(",
"self",
",",
"name",
"=",
"None",
",",
"function",
"=",
"None",
",",
"symbol",
"=",
"None",
",",
"return_type",
"=",
"None",
",",
"arg_types",
"=",
"None",
",",
"header_dir",
"=",
"None",
",",
"header_file",
"=",
"None",
",... | Returns reference to free operator declaration that matches
a defined criteria. | [
"Returns",
"reference",
"to",
"free",
"operator",
"declaration",
"that",
"matches",
"a",
"defined",
"criteria",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/namespace.py#L203-L230 |
3,251 | gccxml/pygccxml | pygccxml/declarations/calldef_types.py | CALLING_CONVENTION_TYPES.extract | def extract(text, default=UNKNOWN):
"""extracts calling convention from the text. If the calling convention
could not be found, the "default"is used"""
if not text:
return default
found = CALLING_CONVENTION_TYPES.pattern.match(text)
if found:
return found.... | python | def extract(text, default=UNKNOWN):
"""extracts calling convention from the text. If the calling convention
could not be found, the "default"is used"""
if not text:
return default
found = CALLING_CONVENTION_TYPES.pattern.match(text)
if found:
return found.... | [
"def",
"extract",
"(",
"text",
",",
"default",
"=",
"UNKNOWN",
")",
":",
"if",
"not",
"text",
":",
"return",
"default",
"found",
"=",
"CALLING_CONVENTION_TYPES",
".",
"pattern",
".",
"match",
"(",
"text",
")",
"if",
"found",
":",
"return",
"found",
".",
... | extracts calling convention from the text. If the calling convention
could not be found, the "default"is used | [
"extracts",
"calling",
"convention",
"from",
"the",
"text",
".",
"If",
"the",
"calling",
"convention",
"could",
"not",
"be",
"found",
"the",
"default",
"is",
"used"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/calldef_types.py#L38-L47 |
3,252 | gccxml/pygccxml | pygccxml/declarations/function_traits.py | is_same_function | def is_same_function(f1, f2):
"""returns true if f1 and f2 is same function
Use case: sometimes when user defines some virtual function in base class,
it overrides it in a derived one. Sometimes we need to know whether two
member functions is actually same function.
"""
if f1 is f2:
ret... | python | def is_same_function(f1, f2):
"""returns true if f1 and f2 is same function
Use case: sometimes when user defines some virtual function in base class,
it overrides it in a derived one. Sometimes we need to know whether two
member functions is actually same function.
"""
if f1 is f2:
ret... | [
"def",
"is_same_function",
"(",
"f1",
",",
"f2",
")",
":",
"if",
"f1",
"is",
"f2",
":",
"return",
"True",
"if",
"f1",
".",
"__class__",
"is",
"not",
"f2",
".",
"__class__",
":",
"return",
"False",
"if",
"isinstance",
"(",
"f1",
",",
"calldef_members",
... | returns true if f1 and f2 is same function
Use case: sometimes when user defines some virtual function in base class,
it overrides it in a derived one. Sometimes we need to know whether two
member functions is actually same function. | [
"returns",
"true",
"if",
"f1",
"and",
"f2",
"is",
"same",
"function"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/function_traits.py#L73-L96 |
3,253 | gccxml/pygccxml | pygccxml/declarations/scopedef.py | make_flatten | def make_flatten(decl_or_decls):
"""
Converts tree representation of declarations to flatten one.
:param decl_or_decls: reference to list of declaration's or single
declaration
:type decl_or_decls: :class:`declaration_t` or [ :class:`declaration_t` ]
:rtype: [ all internal declarations ]
... | python | def make_flatten(decl_or_decls):
"""
Converts tree representation of declarations to flatten one.
:param decl_or_decls: reference to list of declaration's or single
declaration
:type decl_or_decls: :class:`declaration_t` or [ :class:`declaration_t` ]
:rtype: [ all internal declarations ]
... | [
"def",
"make_flatten",
"(",
"decl_or_decls",
")",
":",
"def",
"proceed_single",
"(",
"decl",
")",
":",
"answer",
"=",
"[",
"decl",
"]",
"if",
"not",
"isinstance",
"(",
"decl",
",",
"scopedef_t",
")",
":",
"return",
"answer",
"for",
"elem",
"in",
"decl",
... | Converts tree representation of declarations to flatten one.
:param decl_or_decls: reference to list of declaration's or single
declaration
:type decl_or_decls: :class:`declaration_t` or [ :class:`declaration_t` ]
:rtype: [ all internal declarations ] | [
"Converts",
"tree",
"representation",
"of",
"declarations",
"to",
"flatten",
"one",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/scopedef.py#L1058-L1088 |
3,254 | gccxml/pygccxml | pygccxml/declarations/scopedef.py | find_all_declarations | def find_all_declarations(
declarations,
decl_type=None,
name=None,
parent=None,
recursive=True,
fullname=None):
"""
Returns a list of all declarations that match criteria, defined by
developer.
For more information about arguments see :class:`match_decla... | python | def find_all_declarations(
declarations,
decl_type=None,
name=None,
parent=None,
recursive=True,
fullname=None):
"""
Returns a list of all declarations that match criteria, defined by
developer.
For more information about arguments see :class:`match_decla... | [
"def",
"find_all_declarations",
"(",
"declarations",
",",
"decl_type",
"=",
"None",
",",
"name",
"=",
"None",
",",
"parent",
"=",
"None",
",",
"recursive",
"=",
"True",
",",
"fullname",
"=",
"None",
")",
":",
"if",
"recursive",
":",
"decls",
"=",
"make_f... | Returns a list of all declarations that match criteria, defined by
developer.
For more information about arguments see :class:`match_declaration_t`
class.
:rtype: [ matched declarations ] | [
"Returns",
"a",
"list",
"of",
"all",
"declarations",
"that",
"match",
"criteria",
"defined",
"by",
"developer",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/scopedef.py#L1091-L1121 |
3,255 | gccxml/pygccxml | pygccxml/declarations/scopedef.py | find_declaration | def find_declaration(
declarations,
decl_type=None,
name=None,
parent=None,
recursive=True,
fullname=None):
"""
Returns single declaration that match criteria, defined by developer.
If more the one declaration was found None will be returned.
For more inf... | python | def find_declaration(
declarations,
decl_type=None,
name=None,
parent=None,
recursive=True,
fullname=None):
"""
Returns single declaration that match criteria, defined by developer.
If more the one declaration was found None will be returned.
For more inf... | [
"def",
"find_declaration",
"(",
"declarations",
",",
"decl_type",
"=",
"None",
",",
"name",
"=",
"None",
",",
"parent",
"=",
"None",
",",
"recursive",
"=",
"True",
",",
"fullname",
"=",
"None",
")",
":",
"decl",
"=",
"find_all_declarations",
"(",
"declarat... | Returns single declaration that match criteria, defined by developer.
If more the one declaration was found None will be returned.
For more information about arguments see :class:`match_declaration_t`
class.
:rtype: matched declaration :class:`declaration_t` or None | [
"Returns",
"single",
"declaration",
"that",
"match",
"criteria",
"defined",
"by",
"developer",
".",
"If",
"more",
"the",
"one",
"declaration",
"was",
"found",
"None",
"will",
"be",
"returned",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/scopedef.py#L1124-L1150 |
3,256 | gccxml/pygccxml | pygccxml/declarations/scopedef.py | find_first_declaration | def find_first_declaration(
declarations,
decl_type=None,
name=None,
parent=None,
recursive=True,
fullname=None):
"""
Returns first declaration that match criteria, defined by developer.
For more information about arguments see :class:`match_declaration_t`
... | python | def find_first_declaration(
declarations,
decl_type=None,
name=None,
parent=None,
recursive=True,
fullname=None):
"""
Returns first declaration that match criteria, defined by developer.
For more information about arguments see :class:`match_declaration_t`
... | [
"def",
"find_first_declaration",
"(",
"declarations",
",",
"decl_type",
"=",
"None",
",",
"name",
"=",
"None",
",",
"parent",
"=",
"None",
",",
"recursive",
"=",
"True",
",",
"fullname",
"=",
"None",
")",
":",
"decl_matcher",
"=",
"algorithm",
".",
"match_... | Returns first declaration that match criteria, defined by developer.
For more information about arguments see :class:`match_declaration_t`
class.
:rtype: matched declaration :class:`declaration_t` or None | [
"Returns",
"first",
"declaration",
"that",
"match",
"criteria",
"defined",
"by",
"developer",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/scopedef.py#L1153-L1182 |
3,257 | gccxml/pygccxml | pygccxml/declarations/scopedef.py | declaration_files | def declaration_files(decl_or_decls):
"""
Returns set of files
Every declaration is declared in some file. This function returns set, that
contains all file names of declarations.
:param decl_or_decls: reference to list of declaration's or single
declaration
:type decl_or_decls: :class... | python | def declaration_files(decl_or_decls):
"""
Returns set of files
Every declaration is declared in some file. This function returns set, that
contains all file names of declarations.
:param decl_or_decls: reference to list of declaration's or single
declaration
:type decl_or_decls: :class... | [
"def",
"declaration_files",
"(",
"decl_or_decls",
")",
":",
"files",
"=",
"set",
"(",
")",
"decls",
"=",
"make_flatten",
"(",
"decl_or_decls",
")",
"for",
"decl",
"in",
"decls",
":",
"if",
"decl",
".",
"location",
":",
"files",
".",
"add",
"(",
"decl",
... | Returns set of files
Every declaration is declared in some file. This function returns set, that
contains all file names of declarations.
:param decl_or_decls: reference to list of declaration's or single
declaration
:type decl_or_decls: :class:`declaration_t` or [:class:`declaration_t`]
:... | [
"Returns",
"set",
"of",
"files"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/scopedef.py#L1185-L1204 |
3,258 | gccxml/pygccxml | pygccxml/declarations/scopedef.py | matcher.find | def find(decl_matcher, decls, recursive=True):
"""
Returns a list of declarations that match `decl_matcher` defined
criteria or None
:param decl_matcher: Python callable object, that takes one argument -
reference to a declaration
:param decls: the search scope, :cla... | python | def find(decl_matcher, decls, recursive=True):
"""
Returns a list of declarations that match `decl_matcher` defined
criteria or None
:param decl_matcher: Python callable object, that takes one argument -
reference to a declaration
:param decls: the search scope, :cla... | [
"def",
"find",
"(",
"decl_matcher",
",",
"decls",
",",
"recursive",
"=",
"True",
")",
":",
"where",
"=",
"[",
"]",
"if",
"isinstance",
"(",
"decls",
",",
"list",
")",
":",
"where",
".",
"extend",
"(",
"decls",
")",
"else",
":",
"where",
".",
"appen... | Returns a list of declarations that match `decl_matcher` defined
criteria or None
:param decl_matcher: Python callable object, that takes one argument -
reference to a declaration
:param decls: the search scope, :class:declaration_t object or
:class:declaration_t objects... | [
"Returns",
"a",
"list",
"of",
"declarations",
"that",
"match",
"decl_matcher",
"defined",
"criteria",
"or",
"None"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/scopedef.py#L29-L49 |
3,259 | gccxml/pygccxml | pygccxml/declarations/scopedef.py | matcher.find_single | def find_single(decl_matcher, decls, recursive=True):
"""
Returns a reference to the declaration, that match `decl_matcher`
defined criteria.
if a unique declaration could not be found the method will return None.
:param decl_matcher: Python callable object, that takes one argu... | python | def find_single(decl_matcher, decls, recursive=True):
"""
Returns a reference to the declaration, that match `decl_matcher`
defined criteria.
if a unique declaration could not be found the method will return None.
:param decl_matcher: Python callable object, that takes one argu... | [
"def",
"find_single",
"(",
"decl_matcher",
",",
"decls",
",",
"recursive",
"=",
"True",
")",
":",
"answer",
"=",
"matcher",
".",
"find",
"(",
"decl_matcher",
",",
"decls",
",",
"recursive",
")",
"if",
"len",
"(",
"answer",
")",
"==",
"1",
":",
"return"... | Returns a reference to the declaration, that match `decl_matcher`
defined criteria.
if a unique declaration could not be found the method will return None.
:param decl_matcher: Python callable object, that takes one argument -
reference to a declaration
:param decls: the se... | [
"Returns",
"a",
"reference",
"to",
"the",
"declaration",
"that",
"match",
"decl_matcher",
"defined",
"criteria",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/scopedef.py#L52-L68 |
3,260 | gccxml/pygccxml | pygccxml/declarations/scopedef.py | matcher.get_single | def get_single(decl_matcher, decls, recursive=True):
"""
Returns a reference to declaration, that match `decl_matcher` defined
criteria.
If a unique declaration could not be found, an appropriate exception
will be raised.
:param decl_matcher: Python callable object, tha... | python | def get_single(decl_matcher, decls, recursive=True):
"""
Returns a reference to declaration, that match `decl_matcher` defined
criteria.
If a unique declaration could not be found, an appropriate exception
will be raised.
:param decl_matcher: Python callable object, tha... | [
"def",
"get_single",
"(",
"decl_matcher",
",",
"decls",
",",
"recursive",
"=",
"True",
")",
":",
"answer",
"=",
"matcher",
".",
"find",
"(",
"decl_matcher",
",",
"decls",
",",
"recursive",
")",
"if",
"len",
"(",
"answer",
")",
"==",
"1",
":",
"return",... | Returns a reference to declaration, that match `decl_matcher` defined
criteria.
If a unique declaration could not be found, an appropriate exception
will be raised.
:param decl_matcher: Python callable object, that takes one argument -
reference to a declaration
:pa... | [
"Returns",
"a",
"reference",
"to",
"declaration",
"that",
"match",
"decl_matcher",
"defined",
"criteria",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/scopedef.py#L71-L92 |
3,261 | gccxml/pygccxml | pygccxml/declarations/scopedef.py | scopedef_t.clear_optimizer | def clear_optimizer(self):
"""Cleans query optimizer state"""
self._optimized = False
self._type2decls = {}
self._type2name2decls = {}
self._type2decls_nr = {}
self._type2name2decls_nr = {}
self._all_decls = None
self._all_decls_not_recursive = None
... | python | def clear_optimizer(self):
"""Cleans query optimizer state"""
self._optimized = False
self._type2decls = {}
self._type2name2decls = {}
self._type2decls_nr = {}
self._type2name2decls_nr = {}
self._all_decls = None
self._all_decls_not_recursive = None
... | [
"def",
"clear_optimizer",
"(",
"self",
")",
":",
"self",
".",
"_optimized",
"=",
"False",
"self",
".",
"_type2decls",
"=",
"{",
"}",
"self",
".",
"_type2name2decls",
"=",
"{",
"}",
"self",
".",
"_type2decls_nr",
"=",
"{",
"}",
"self",
".",
"_type2name2de... | Cleans query optimizer state | [
"Cleans",
"query",
"optimizer",
"state"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/scopedef.py#L248-L260 |
3,262 | gccxml/pygccxml | pygccxml/declarations/scopedef.py | scopedef_t.init_optimizer | def init_optimizer(self):
"""
Initializes query optimizer state.
There are 4 internals hash tables:
1. from type to declarations
2. from type to declarations for non-recursive queries
3. from type to name to declarations
4. from type to name to de... | python | def init_optimizer(self):
"""
Initializes query optimizer state.
There are 4 internals hash tables:
1. from type to declarations
2. from type to declarations for non-recursive queries
3. from type to name to declarations
4. from type to name to de... | [
"def",
"init_optimizer",
"(",
"self",
")",
":",
"if",
"self",
".",
"name",
"==",
"'::'",
":",
"self",
".",
"_logger",
".",
"debug",
"(",
"\"preparing data structures for query optimizer - started\"",
")",
"start_time",
"=",
"timeit",
".",
"default_timer",
"(",
"... | Initializes query optimizer state.
There are 4 internals hash tables:
1. from type to declarations
2. from type to declarations for non-recursive queries
3. from type to name to declarations
4. from type to name to declarations for non-recursive queries
... | [
"Initializes",
"query",
"optimizer",
"state",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/scopedef.py#L262-L314 |
3,263 | gccxml/pygccxml | pygccxml/declarations/scopedef.py | scopedef_t.decls | def decls(
self,
name=None,
function=None,
decl_type=None,
header_dir=None,
header_file=None,
recursive=None,
allow_empty=None):
"""returns a set of declarations, that are matched defined criteria"""
return (... | python | def decls(
self,
name=None,
function=None,
decl_type=None,
header_dir=None,
header_file=None,
recursive=None,
allow_empty=None):
"""returns a set of declarations, that are matched defined criteria"""
return (... | [
"def",
"decls",
"(",
"self",
",",
"name",
"=",
"None",
",",
"function",
"=",
"None",
",",
"decl_type",
"=",
"None",
",",
"header_dir",
"=",
"None",
",",
"header_file",
"=",
"None",
",",
"recursive",
"=",
"None",
",",
"allow_empty",
"=",
"None",
")",
... | returns a set of declarations, that are matched defined criteria | [
"returns",
"a",
"set",
"of",
"declarations",
"that",
"are",
"matched",
"defined",
"criteria"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/scopedef.py#L515-L536 |
3,264 | gccxml/pygccxml | pygccxml/declarations/scopedef.py | scopedef_t.classes | def classes(
self,
name=None,
function=None,
header_dir=None,
header_file=None,
recursive=None,
allow_empty=None):
"""returns a set of class declarations, that are matched defined
criteria"""
return (
... | python | def classes(
self,
name=None,
function=None,
header_dir=None,
header_file=None,
recursive=None,
allow_empty=None):
"""returns a set of class declarations, that are matched defined
criteria"""
return (
... | [
"def",
"classes",
"(",
"self",
",",
"name",
"=",
"None",
",",
"function",
"=",
"None",
",",
"header_dir",
"=",
"None",
",",
"header_file",
"=",
"None",
",",
"recursive",
"=",
"None",
",",
"allow_empty",
"=",
"None",
")",
":",
"return",
"(",
"self",
"... | returns a set of class declarations, that are matched defined
criteria | [
"returns",
"a",
"set",
"of",
"class",
"declarations",
"that",
"are",
"matched",
"defined",
"criteria"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/scopedef.py#L559-L580 |
3,265 | gccxml/pygccxml | pygccxml/declarations/scopedef.py | scopedef_t.variable | def variable(
self,
name=None,
function=None,
decl_type=None,
header_dir=None,
header_file=None,
recursive=None):
"""returns reference to variable declaration, that is matched defined
criteria"""
return (
... | python | def variable(
self,
name=None,
function=None,
decl_type=None,
header_dir=None,
header_file=None,
recursive=None):
"""returns reference to variable declaration, that is matched defined
criteria"""
return (
... | [
"def",
"variable",
"(",
"self",
",",
"name",
"=",
"None",
",",
"function",
"=",
"None",
",",
"decl_type",
"=",
"None",
",",
"header_dir",
"=",
"None",
",",
"header_file",
"=",
"None",
",",
"recursive",
"=",
"None",
")",
":",
"return",
"(",
"self",
".... | returns reference to variable declaration, that is matched defined
criteria | [
"returns",
"reference",
"to",
"variable",
"declaration",
"that",
"is",
"matched",
"defined",
"criteria"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/scopedef.py#L582-L603 |
3,266 | gccxml/pygccxml | pygccxml/declarations/scopedef.py | scopedef_t.variables | def variables(
self,
name=None,
function=None,
decl_type=None,
header_dir=None,
header_file=None,
recursive=None,
allow_empty=None):
"""returns a set of variable declarations, that are matched defined
criter... | python | def variables(
self,
name=None,
function=None,
decl_type=None,
header_dir=None,
header_file=None,
recursive=None,
allow_empty=None):
"""returns a set of variable declarations, that are matched defined
criter... | [
"def",
"variables",
"(",
"self",
",",
"name",
"=",
"None",
",",
"function",
"=",
"None",
",",
"decl_type",
"=",
"None",
",",
"header_dir",
"=",
"None",
",",
"header_file",
"=",
"None",
",",
"recursive",
"=",
"None",
",",
"allow_empty",
"=",
"None",
")"... | returns a set of variable declarations, that are matched defined
criteria | [
"returns",
"a",
"set",
"of",
"variable",
"declarations",
"that",
"are",
"matched",
"defined",
"criteria"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/scopedef.py#L605-L628 |
3,267 | gccxml/pygccxml | pygccxml/declarations/scopedef.py | scopedef_t.member_functions | def member_functions(
self,
name=None,
function=None,
return_type=None,
arg_types=None,
header_dir=None,
header_file=None,
recursive=None,
allow_empty=None):
"""returns a set of member function declaratio... | python | def member_functions(
self,
name=None,
function=None,
return_type=None,
arg_types=None,
header_dir=None,
header_file=None,
recursive=None,
allow_empty=None):
"""returns a set of member function declaratio... | [
"def",
"member_functions",
"(",
"self",
",",
"name",
"=",
"None",
",",
"function",
"=",
"None",
",",
"return_type",
"=",
"None",
",",
"arg_types",
"=",
"None",
",",
"header_dir",
"=",
"None",
",",
"header_file",
"=",
"None",
",",
"recursive",
"=",
"None"... | returns a set of member function declarations, that are matched
defined criteria | [
"returns",
"a",
"set",
"of",
"member",
"function",
"declarations",
"that",
"are",
"matched",
"defined",
"criteria"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/scopedef.py#L767-L792 |
3,268 | gccxml/pygccxml | pygccxml/declarations/scopedef.py | scopedef_t.constructor | def constructor(
self,
name=None,
function=None,
return_type=None,
arg_types=None,
header_dir=None,
header_file=None,
recursive=None):
"""returns reference to constructor declaration, that is matched
defined ... | python | def constructor(
self,
name=None,
function=None,
return_type=None,
arg_types=None,
header_dir=None,
header_file=None,
recursive=None):
"""returns reference to constructor declaration, that is matched
defined ... | [
"def",
"constructor",
"(",
"self",
",",
"name",
"=",
"None",
",",
"function",
"=",
"None",
",",
"return_type",
"=",
"None",
",",
"arg_types",
"=",
"None",
",",
"header_dir",
"=",
"None",
",",
"header_file",
"=",
"None",
",",
"recursive",
"=",
"None",
"... | returns reference to constructor declaration, that is matched
defined criteria | [
"returns",
"reference",
"to",
"constructor",
"declaration",
"that",
"is",
"matched",
"defined",
"criteria"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/scopedef.py#L794-L817 |
3,269 | gccxml/pygccxml | pygccxml/declarations/scopedef.py | scopedef_t.constructors | def constructors(
self,
name=None,
function=None,
return_type=None,
arg_types=None,
header_dir=None,
header_file=None,
recursive=None,
allow_empty=None):
"""returns a set of constructor declarations, that... | python | def constructors(
self,
name=None,
function=None,
return_type=None,
arg_types=None,
header_dir=None,
header_file=None,
recursive=None,
allow_empty=None):
"""returns a set of constructor declarations, that... | [
"def",
"constructors",
"(",
"self",
",",
"name",
"=",
"None",
",",
"function",
"=",
"None",
",",
"return_type",
"=",
"None",
",",
"arg_types",
"=",
"None",
",",
"header_dir",
"=",
"None",
",",
"header_file",
"=",
"None",
",",
"recursive",
"=",
"None",
... | returns a set of constructor declarations, that are matched
defined criteria | [
"returns",
"a",
"set",
"of",
"constructor",
"declarations",
"that",
"are",
"matched",
"defined",
"criteria"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/scopedef.py#L819-L844 |
3,270 | gccxml/pygccxml | pygccxml/declarations/scopedef.py | scopedef_t.casting_operators | def casting_operators(
self,
name=None,
function=None,
return_type=None,
arg_types=None,
header_dir=None,
header_file=None,
recursive=None,
allow_empty=None):
"""returns a set of casting operator declarat... | python | def casting_operators(
self,
name=None,
function=None,
return_type=None,
arg_types=None,
header_dir=None,
header_file=None,
recursive=None,
allow_empty=None):
"""returns a set of casting operator declarat... | [
"def",
"casting_operators",
"(",
"self",
",",
"name",
"=",
"None",
",",
"function",
"=",
"None",
",",
"return_type",
"=",
"None",
",",
"arg_types",
"=",
"None",
",",
"header_dir",
"=",
"None",
",",
"header_file",
"=",
"None",
",",
"recursive",
"=",
"None... | returns a set of casting operator declarations, that are matched
defined criteria | [
"returns",
"a",
"set",
"of",
"casting",
"operator",
"declarations",
"that",
"are",
"matched",
"defined",
"criteria"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/scopedef.py#L931-L956 |
3,271 | gccxml/pygccxml | pygccxml/declarations/scopedef.py | scopedef_t.enumerations | def enumerations(
self,
name=None,
function=None,
header_dir=None,
header_file=None,
recursive=None,
allow_empty=None):
"""returns a set of enumeration declarations, that are matched
defined criteria"""
return (
... | python | def enumerations(
self,
name=None,
function=None,
header_dir=None,
header_file=None,
recursive=None,
allow_empty=None):
"""returns a set of enumeration declarations, that are matched
defined criteria"""
return (
... | [
"def",
"enumerations",
"(",
"self",
",",
"name",
"=",
"None",
",",
"function",
"=",
"None",
",",
"header_dir",
"=",
"None",
",",
"header_file",
"=",
"None",
",",
"recursive",
"=",
"None",
",",
"allow_empty",
"=",
"None",
")",
":",
"return",
"(",
"self"... | returns a set of enumeration declarations, that are matched
defined criteria | [
"returns",
"a",
"set",
"of",
"enumeration",
"declarations",
"that",
"are",
"matched",
"defined",
"criteria"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/scopedef.py#L979-L1000 |
3,272 | gccxml/pygccxml | pygccxml/declarations/scopedef.py | scopedef_t.typedef | def typedef(
self,
name=None,
function=None,
header_dir=None,
header_file=None,
recursive=None):
"""returns reference to typedef declaration, that is matched
defined criteria"""
return (
self._find_single(
... | python | def typedef(
self,
name=None,
function=None,
header_dir=None,
header_file=None,
recursive=None):
"""returns reference to typedef declaration, that is matched
defined criteria"""
return (
self._find_single(
... | [
"def",
"typedef",
"(",
"self",
",",
"name",
"=",
"None",
",",
"function",
"=",
"None",
",",
"header_dir",
"=",
"None",
",",
"header_file",
"=",
"None",
",",
"recursive",
"=",
"None",
")",
":",
"return",
"(",
"self",
".",
"_find_single",
"(",
"self",
... | returns reference to typedef declaration, that is matched
defined criteria | [
"returns",
"reference",
"to",
"typedef",
"declaration",
"that",
"is",
"matched",
"defined",
"criteria"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/scopedef.py#L1002-L1021 |
3,273 | gccxml/pygccxml | pygccxml/declarations/scopedef.py | scopedef_t.typedefs | def typedefs(
self,
name=None,
function=None,
header_dir=None,
header_file=None,
recursive=None,
allow_empty=None):
"""returns a set of typedef declarations, that are matched
defined criteria"""
return (
... | python | def typedefs(
self,
name=None,
function=None,
header_dir=None,
header_file=None,
recursive=None,
allow_empty=None):
"""returns a set of typedef declarations, that are matched
defined criteria"""
return (
... | [
"def",
"typedefs",
"(",
"self",
",",
"name",
"=",
"None",
",",
"function",
"=",
"None",
",",
"header_dir",
"=",
"None",
",",
"header_file",
"=",
"None",
",",
"recursive",
"=",
"None",
",",
"allow_empty",
"=",
"None",
")",
":",
"return",
"(",
"self",
... | returns a set of typedef declarations, that are matched
defined criteria | [
"returns",
"a",
"set",
"of",
"typedef",
"declarations",
"that",
"are",
"matched",
"defined",
"criteria"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/scopedef.py#L1023-L1044 |
3,274 | gccxml/pygccxml | pygccxml/parser/config.py | load_xml_generator_configuration | def load_xml_generator_configuration(configuration, **defaults):
"""
Loads CastXML or GCC-XML configuration.
Args:
configuration (string|configparser.ConfigParser): can be
a string (file path to a configuration file) or
instance of :class:`configparser.ConfigParser`.
... | python | def load_xml_generator_configuration(configuration, **defaults):
"""
Loads CastXML or GCC-XML configuration.
Args:
configuration (string|configparser.ConfigParser): can be
a string (file path to a configuration file) or
instance of :class:`configparser.ConfigParser`.
... | [
"def",
"load_xml_generator_configuration",
"(",
"configuration",
",",
"*",
"*",
"defaults",
")",
":",
"parser",
"=",
"configuration",
"if",
"utils",
".",
"is_str",
"(",
"configuration",
")",
":",
"parser",
"=",
"ConfigParser",
"(",
")",
"parser",
".",
"read",
... | Loads CastXML or GCC-XML configuration.
Args:
configuration (string|configparser.ConfigParser): can be
a string (file path to a configuration file) or
instance of :class:`configparser.ConfigParser`.
defaults: can be used to override single configuration values.
Retu... | [
"Loads",
"CastXML",
"or",
"GCC",
"-",
"XML",
"configuration",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/parser/config.py#L333-L410 |
3,275 | gccxml/pygccxml | pygccxml/parser/config.py | create_compiler_path | def create_compiler_path(xml_generator, compiler_path):
"""
Try to guess a path for the compiler.
If you want ot use a specific compiler, please provide the compiler
path manually, as the guess may not be what you are expecting.
Providing the path can be done by passing it as an argument (compiler_... | python | def create_compiler_path(xml_generator, compiler_path):
"""
Try to guess a path for the compiler.
If you want ot use a specific compiler, please provide the compiler
path manually, as the guess may not be what you are expecting.
Providing the path can be done by passing it as an argument (compiler_... | [
"def",
"create_compiler_path",
"(",
"xml_generator",
",",
"compiler_path",
")",
":",
"if",
"xml_generator",
"==",
"'castxml'",
"and",
"compiler_path",
"is",
"None",
":",
"if",
"platform",
".",
"system",
"(",
")",
"==",
"'Windows'",
":",
"# Look for msvc",
"p",
... | Try to guess a path for the compiler.
If you want ot use a specific compiler, please provide the compiler
path manually, as the guess may not be what you are expecting.
Providing the path can be done by passing it as an argument (compiler_path)
to the xml_generator_configuration_t() or by defining it i... | [
"Try",
"to",
"guess",
"a",
"path",
"for",
"the",
"compiler",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/parser/config.py#L413-L471 |
3,276 | gccxml/pygccxml | pygccxml/parser/config.py | parser_configuration_t.raise_on_wrong_settings | def raise_on_wrong_settings(self):
"""
Validates the configuration settings and raises RuntimeError on error
"""
self.__ensure_dir_exists(self.working_directory, 'working directory')
for idir in self.include_paths:
self.__ensure_dir_exists(idir, 'include directory')
... | python | def raise_on_wrong_settings(self):
"""
Validates the configuration settings and raises RuntimeError on error
"""
self.__ensure_dir_exists(self.working_directory, 'working directory')
for idir in self.include_paths:
self.__ensure_dir_exists(idir, 'include directory')
... | [
"def",
"raise_on_wrong_settings",
"(",
"self",
")",
":",
"self",
".",
"__ensure_dir_exists",
"(",
"self",
".",
"working_directory",
",",
"'working directory'",
")",
"for",
"idir",
"in",
"self",
".",
"include_paths",
":",
"self",
".",
"__ensure_dir_exists",
"(",
... | Validates the configuration settings and raises RuntimeError on error | [
"Validates",
"the",
"configuration",
"settings",
"and",
"raises",
"RuntimeError",
"on",
"error"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/parser/config.py#L210-L220 |
3,277 | gccxml/pygccxml | pygccxml/declarations/declaration_utils.py | declaration_path | def declaration_path(decl):
"""
Returns a list of parent declarations names.
Args:
decl (declaration_t): declaration for which declaration path
should be calculated.
Returns:
list[(str | basestring)]: list of names, where first item is the top
... | python | def declaration_path(decl):
"""
Returns a list of parent declarations names.
Args:
decl (declaration_t): declaration for which declaration path
should be calculated.
Returns:
list[(str | basestring)]: list of names, where first item is the top
... | [
"def",
"declaration_path",
"(",
"decl",
")",
":",
"if",
"not",
"decl",
":",
"return",
"[",
"]",
"if",
"not",
"decl",
".",
"cache",
".",
"declaration_path",
":",
"result",
"=",
"[",
"decl",
".",
"name",
"]",
"parent",
"=",
"decl",
".",
"parent",
"whil... | Returns a list of parent declarations names.
Args:
decl (declaration_t): declaration for which declaration path
should be calculated.
Returns:
list[(str | basestring)]: list of names, where first item is the top
parent name and la... | [
"Returns",
"a",
"list",
"of",
"parent",
"declarations",
"names",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/declaration_utils.py#L7-L39 |
3,278 | gccxml/pygccxml | pygccxml/declarations/declaration_utils.py | partial_declaration_path | def partial_declaration_path(decl):
"""
Returns a list of parent declarations names without template arguments that
have default value.
Args:
decl (declaration_t): declaration for which the partial declaration
path should be calculated.
Returns:
list[(... | python | def partial_declaration_path(decl):
"""
Returns a list of parent declarations names without template arguments that
have default value.
Args:
decl (declaration_t): declaration for which the partial declaration
path should be calculated.
Returns:
list[(... | [
"def",
"partial_declaration_path",
"(",
"decl",
")",
":",
"# TODO:",
"# If parent declaration cache already has declaration_path, reuse it for",
"# calculation.",
"if",
"not",
"decl",
":",
"return",
"[",
"]",
"if",
"not",
"decl",
".",
"cache",
".",
"partial_declaration_pa... | Returns a list of parent declarations names without template arguments that
have default value.
Args:
decl (declaration_t): declaration for which the partial declaration
path should be calculated.
Returns:
list[(str | basestring)]: list of names, where first i... | [
"Returns",
"a",
"list",
"of",
"parent",
"declarations",
"names",
"without",
"template",
"arguments",
"that",
"have",
"default",
"value",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/declaration_utils.py#L42-L78 |
3,279 | gccxml/pygccxml | pygccxml/declarations/declaration_utils.py | full_name | def full_name(decl, with_defaults=True):
"""
Returns declaration full qualified name.
If `decl` belongs to anonymous namespace or class, the function will return
C++ illegal qualified name.
Args:
decl (declaration_t): declaration for which the full qualified name
... | python | def full_name(decl, with_defaults=True):
"""
Returns declaration full qualified name.
If `decl` belongs to anonymous namespace or class, the function will return
C++ illegal qualified name.
Args:
decl (declaration_t): declaration for which the full qualified name
... | [
"def",
"full_name",
"(",
"decl",
",",
"with_defaults",
"=",
"True",
")",
":",
"if",
"None",
"is",
"decl",
":",
"raise",
"RuntimeError",
"(",
"\"Unable to generate full name for None object!\"",
")",
"if",
"with_defaults",
":",
"if",
"not",
"decl",
".",
"cache",
... | Returns declaration full qualified name.
If `decl` belongs to anonymous namespace or class, the function will return
C++ illegal qualified name.
Args:
decl (declaration_t): declaration for which the full qualified name
should be calculated.
Returns:
list[... | [
"Returns",
"declaration",
"full",
"qualified",
"name",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/declaration_utils.py#L90-L128 |
3,280 | gccxml/pygccxml | pygccxml/declarations/declaration_utils.py | get_named_parent | def get_named_parent(decl):
"""
Returns a reference to a named parent declaration.
Args:
decl (declaration_t): the child declaration
Returns:
declaration_t: the declaration or None if not found.
"""
if not decl:
return None
parent = decl.parent
while parent a... | python | def get_named_parent(decl):
"""
Returns a reference to a named parent declaration.
Args:
decl (declaration_t): the child declaration
Returns:
declaration_t: the declaration or None if not found.
"""
if not decl:
return None
parent = decl.parent
while parent a... | [
"def",
"get_named_parent",
"(",
"decl",
")",
":",
"if",
"not",
"decl",
":",
"return",
"None",
"parent",
"=",
"decl",
".",
"parent",
"while",
"parent",
"and",
"(",
"not",
"parent",
".",
"name",
"or",
"parent",
".",
"name",
"==",
"'::'",
")",
":",
"par... | Returns a reference to a named parent declaration.
Args:
decl (declaration_t): the child declaration
Returns:
declaration_t: the declaration or None if not found. | [
"Returns",
"a",
"reference",
"to",
"a",
"named",
"parent",
"declaration",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/declaration_utils.py#L131-L149 |
3,281 | gccxml/pygccxml | pygccxml/declarations/decl_printer.py | print_declarations | def print_declarations(
decls,
detailed=True,
recursive=True,
writer=lambda x: sys.stdout.write(x + os.linesep),
verbose=True):
"""
print declarations tree rooted at each of the included nodes.
:param decls: either a single :class:declaration_t object or list
... | python | def print_declarations(
decls,
detailed=True,
recursive=True,
writer=lambda x: sys.stdout.write(x + os.linesep),
verbose=True):
"""
print declarations tree rooted at each of the included nodes.
:param decls: either a single :class:declaration_t object or list
... | [
"def",
"print_declarations",
"(",
"decls",
",",
"detailed",
"=",
"True",
",",
"recursive",
"=",
"True",
",",
"writer",
"=",
"lambda",
"x",
":",
"sys",
".",
"stdout",
".",
"write",
"(",
"x",
"+",
"os",
".",
"linesep",
")",
",",
"verbose",
"=",
"True",... | print declarations tree rooted at each of the included nodes.
:param decls: either a single :class:declaration_t object or list
of :class:declaration_t objects | [
"print",
"declarations",
"tree",
"rooted",
"at",
"each",
"of",
"the",
"included",
"nodes",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/decl_printer.py#L434-L452 |
3,282 | gccxml/pygccxml | pygccxml/declarations/decl_printer.py | dump_declarations | def dump_declarations(declarations, file_path):
"""
Dump declarations tree rooted at each of the included nodes to the file
:param declarations: either a single :class:declaration_t object or a list
of :class:declaration_t objects
:param file_path: path to a file
"""
with open(file_pa... | python | def dump_declarations(declarations, file_path):
"""
Dump declarations tree rooted at each of the included nodes to the file
:param declarations: either a single :class:declaration_t object or a list
of :class:declaration_t objects
:param file_path: path to a file
"""
with open(file_pa... | [
"def",
"dump_declarations",
"(",
"declarations",
",",
"file_path",
")",
":",
"with",
"open",
"(",
"file_path",
",",
"\"w+\"",
")",
"as",
"f",
":",
"print_declarations",
"(",
"declarations",
",",
"writer",
"=",
"f",
".",
"write",
")"
] | Dump declarations tree rooted at each of the included nodes to the file
:param declarations: either a single :class:declaration_t object or a list
of :class:declaration_t objects
:param file_path: path to a file | [
"Dump",
"declarations",
"tree",
"rooted",
"at",
"each",
"of",
"the",
"included",
"nodes",
"to",
"the",
"file"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/decl_printer.py#L455-L466 |
3,283 | gccxml/pygccxml | pygccxml/parser/source_reader.py | source_reader_t.__add_symbols | def __add_symbols(self, cmd):
"""
Add all additional defined and undefined symbols.
"""
if self.__config.define_symbols:
symbols = self.__config.define_symbols
cmd.append(''.join(
[' -D"%s"' % def_symbol for def_symbol in symbols]))
if s... | python | def __add_symbols(self, cmd):
"""
Add all additional defined and undefined symbols.
"""
if self.__config.define_symbols:
symbols = self.__config.define_symbols
cmd.append(''.join(
[' -D"%s"' % def_symbol for def_symbol in symbols]))
if s... | [
"def",
"__add_symbols",
"(",
"self",
",",
"cmd",
")",
":",
"if",
"self",
".",
"__config",
".",
"define_symbols",
":",
"symbols",
"=",
"self",
".",
"__config",
".",
"define_symbols",
"cmd",
".",
"append",
"(",
"''",
".",
"join",
"(",
"[",
"' -D\"%s\"'",
... | Add all additional defined and undefined symbols. | [
"Add",
"all",
"additional",
"defined",
"and",
"undefined",
"symbols",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/parser/source_reader.py#L183-L199 |
3,284 | gccxml/pygccxml | pygccxml/parser/source_reader.py | source_reader_t.create_xml_file | def create_xml_file(self, source_file, destination=None):
"""
This method will generate a xml file using an external tool.
The method will return the file path of the generated xml file.
:param source_file: path to the source file that should be parsed.
:type source_file: str
... | python | def create_xml_file(self, source_file, destination=None):
"""
This method will generate a xml file using an external tool.
The method will return the file path of the generated xml file.
:param source_file: path to the source file that should be parsed.
:type source_file: str
... | [
"def",
"create_xml_file",
"(",
"self",
",",
"source_file",
",",
"destination",
"=",
"None",
")",
":",
"xml_file",
"=",
"destination",
"# If file specified, remove it to start else create new file name",
"if",
"xml_file",
":",
"utils",
".",
"remove_file_no_raise",
"(",
"... | This method will generate a xml file using an external tool.
The method will return the file path of the generated xml file.
:param source_file: path to the source file that should be parsed.
:type source_file: str
:param destination: if given, will be used as target file path for
... | [
"This",
"method",
"will",
"generate",
"a",
"xml",
"file",
"using",
"an",
"external",
"tool",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/parser/source_reader.py#L201-L273 |
3,285 | gccxml/pygccxml | pygccxml/parser/source_reader.py | source_reader_t.create_xml_file_from_string | def create_xml_file_from_string(self, content, destination=None):
"""
Creates XML file from text.
:param content: C++ source code
:type content: str
:param destination: file name for xml file
:type destination: str
:rtype: returns file name of xml file
... | python | def create_xml_file_from_string(self, content, destination=None):
"""
Creates XML file from text.
:param content: C++ source code
:type content: str
:param destination: file name for xml file
:type destination: str
:rtype: returns file name of xml file
... | [
"def",
"create_xml_file_from_string",
"(",
"self",
",",
"content",
",",
"destination",
"=",
"None",
")",
":",
"header_file",
"=",
"utils",
".",
"create_temp_file_name",
"(",
"suffix",
"=",
"'.h'",
")",
"try",
":",
"with",
"open",
"(",
"header_file",
",",
"\"... | Creates XML file from text.
:param content: C++ source code
:type content: str
:param destination: file name for xml file
:type destination: str
:rtype: returns file name of xml file | [
"Creates",
"XML",
"file",
"from",
"text",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/parser/source_reader.py#L275-L295 |
3,286 | gccxml/pygccxml | pygccxml/parser/source_reader.py | source_reader_t.read_cpp_source_file | def read_cpp_source_file(self, source_file):
"""
Reads C++ source file and returns declarations tree
:param source_file: path to C++ source file
:type source_file: str
"""
xml_file = ''
try:
ffname = self.__file_full_name(source_file)
se... | python | def read_cpp_source_file(self, source_file):
"""
Reads C++ source file and returns declarations tree
:param source_file: path to C++ source file
:type source_file: str
"""
xml_file = ''
try:
ffname = self.__file_full_name(source_file)
se... | [
"def",
"read_cpp_source_file",
"(",
"self",
",",
"source_file",
")",
":",
"xml_file",
"=",
"''",
"try",
":",
"ffname",
"=",
"self",
".",
"__file_full_name",
"(",
"source_file",
")",
"self",
".",
"logger",
".",
"debug",
"(",
"\"Reading source file: [%s].\"",
",... | Reads C++ source file and returns declarations tree
:param source_file: path to C++ source file
:type source_file: str | [
"Reads",
"C",
"++",
"source",
"file",
"and",
"returns",
"declarations",
"tree"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/parser/source_reader.py#L300-L332 |
3,287 | gccxml/pygccxml | pygccxml/parser/source_reader.py | source_reader_t.read_xml_file | def read_xml_file(self, xml_file):
"""
Read generated XML file.
:param xml_file: path to xml file
:type xml_file: str
:rtype: declarations tree
"""
assert self.__config is not None
ffname = self.__file_full_name(xml_file)
self.logger.debug("Re... | python | def read_xml_file(self, xml_file):
"""
Read generated XML file.
:param xml_file: path to xml file
:type xml_file: str
:rtype: declarations tree
"""
assert self.__config is not None
ffname = self.__file_full_name(xml_file)
self.logger.debug("Re... | [
"def",
"read_xml_file",
"(",
"self",
",",
"xml_file",
")",
":",
"assert",
"self",
".",
"__config",
"is",
"not",
"None",
"ffname",
"=",
"self",
".",
"__file_full_name",
"(",
"xml_file",
")",
"self",
".",
"logger",
".",
"debug",
"(",
"\"Reading xml file: [%s]\... | Read generated XML file.
:param xml_file: path to xml file
:type xml_file: str
:rtype: declarations tree | [
"Read",
"generated",
"XML",
"file",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/parser/source_reader.py#L334-L358 |
3,288 | gccxml/pygccxml | pygccxml/parser/source_reader.py | source_reader_t.read_string | def read_string(self, content):
"""
Reads a Python string that contains C++ code, and return
the declarations tree.
"""
header_file = utils.create_temp_file_name(suffix='.h')
with open(header_file, "w+") as f:
f.write(content)
try:
decls... | python | def read_string(self, content):
"""
Reads a Python string that contains C++ code, and return
the declarations tree.
"""
header_file = utils.create_temp_file_name(suffix='.h')
with open(header_file, "w+") as f:
f.write(content)
try:
decls... | [
"def",
"read_string",
"(",
"self",
",",
"content",
")",
":",
"header_file",
"=",
"utils",
".",
"create_temp_file_name",
"(",
"suffix",
"=",
"'.h'",
")",
"with",
"open",
"(",
"header_file",
",",
"\"w+\"",
")",
"as",
"f",
":",
"f",
".",
"write",
"(",
"co... | Reads a Python string that contains C++ code, and return
the declarations tree. | [
"Reads",
"a",
"Python",
"string",
"that",
"contains",
"C",
"++",
"code",
"and",
"return",
"the",
"declarations",
"tree",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/parser/source_reader.py#L360-L378 |
3,289 | gccxml/pygccxml | pygccxml/declarations/algorithm.py | apply_visitor | def apply_visitor(visitor, decl_inst):
"""
Applies a visitor on declaration instance.
:param visitor: instance
:type visitor: :class:`type_visitor_t` or :class:`decl_visitor_t`
"""
fname = 'visit_' + \
decl_inst.__class__.__name__[:-2] # removing '_t' from class name
if not hasat... | python | def apply_visitor(visitor, decl_inst):
"""
Applies a visitor on declaration instance.
:param visitor: instance
:type visitor: :class:`type_visitor_t` or :class:`decl_visitor_t`
"""
fname = 'visit_' + \
decl_inst.__class__.__name__[:-2] # removing '_t' from class name
if not hasat... | [
"def",
"apply_visitor",
"(",
"visitor",
",",
"decl_inst",
")",
":",
"fname",
"=",
"'visit_'",
"+",
"decl_inst",
".",
"__class__",
".",
"__name__",
"[",
":",
"-",
"2",
"]",
"# removing '_t' from class name",
"if",
"not",
"hasattr",
"(",
"visitor",
",",
"fname... | Applies a visitor on declaration instance.
:param visitor: instance
:type visitor: :class:`type_visitor_t` or :class:`decl_visitor_t` | [
"Applies",
"a",
"visitor",
"on",
"declaration",
"instance",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/algorithm.py#L73-L87 |
3,290 | gccxml/pygccxml | pygccxml/declarations/algorithm.py | match_declaration_t.does_match_exist | def does_match_exist(self, inst):
"""
Returns True if inst does match one of specified criteria.
:param inst: declaration instance
:type inst: :class:`declaration_t`
:rtype: bool
"""
answer = True
if self._decl_type is not None:
answer &= i... | python | def does_match_exist(self, inst):
"""
Returns True if inst does match one of specified criteria.
:param inst: declaration instance
:type inst: :class:`declaration_t`
:rtype: bool
"""
answer = True
if self._decl_type is not None:
answer &= i... | [
"def",
"does_match_exist",
"(",
"self",
",",
"inst",
")",
":",
"answer",
"=",
"True",
"if",
"self",
".",
"_decl_type",
"is",
"not",
"None",
":",
"answer",
"&=",
"isinstance",
"(",
"inst",
",",
"self",
".",
"_decl_type",
")",
"if",
"self",
".",
"name",
... | Returns True if inst does match one of specified criteria.
:param inst: declaration instance
:type inst: :class:`declaration_t`
:rtype: bool | [
"Returns",
"True",
"if",
"inst",
"does",
"match",
"one",
"of",
"specified",
"criteria",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/algorithm.py#L37-L60 |
3,291 | gccxml/pygccxml | pygccxml/declarations/declaration.py | declaration_t.partial_name | def partial_name(self):
"""
Declaration name, without template default arguments.
Right now std containers is the only classes that support this
functionality.
"""
if None is self._partial_name:
self._partial_name = self._get_partial_name_impl()
re... | python | def partial_name(self):
"""
Declaration name, without template default arguments.
Right now std containers is the only classes that support this
functionality.
"""
if None is self._partial_name:
self._partial_name = self._get_partial_name_impl()
re... | [
"def",
"partial_name",
"(",
"self",
")",
":",
"if",
"None",
"is",
"self",
".",
"_partial_name",
":",
"self",
".",
"_partial_name",
"=",
"self",
".",
"_get_partial_name_impl",
"(",
")",
"return",
"self",
".",
"_partial_name"
] | Declaration name, without template default arguments.
Right now std containers is the only classes that support this
functionality. | [
"Declaration",
"name",
"without",
"template",
"default",
"arguments",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/declaration.py#L175-L187 |
3,292 | gccxml/pygccxml | pygccxml/declarations/declaration.py | declaration_t.top_parent | def top_parent(self):
"""
Reference to top parent declaration.
@type: declaration_t
"""
parent = self.parent
while parent is not None:
if parent.parent is None:
return parent
else:
parent = parent.parent
... | python | def top_parent(self):
"""
Reference to top parent declaration.
@type: declaration_t
"""
parent = self.parent
while parent is not None:
if parent.parent is None:
return parent
else:
parent = parent.parent
... | [
"def",
"top_parent",
"(",
"self",
")",
":",
"parent",
"=",
"self",
".",
"parent",
"while",
"parent",
"is",
"not",
"None",
":",
"if",
"parent",
".",
"parent",
"is",
"None",
":",
"return",
"parent",
"else",
":",
"parent",
"=",
"parent",
".",
"parent",
... | Reference to top parent declaration.
@type: declaration_t | [
"Reference",
"to",
"top",
"parent",
"declaration",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/declaration.py#L208-L221 |
3,293 | gccxml/pygccxml | pygccxml/declarations/calldef.py | argument_t.clone | def clone(self, **keywd):
"""constructs new argument_t instance
return argument_t(
name=keywd.get('name', self.name),
decl_type=keywd.get('decl_type', self.decl_type),
default_value=keywd.get('default_value', self.default_value),
attributes=keywd.get('att... | python | def clone(self, **keywd):
"""constructs new argument_t instance
return argument_t(
name=keywd.get('name', self.name),
decl_type=keywd.get('decl_type', self.decl_type),
default_value=keywd.get('default_value', self.default_value),
attributes=keywd.get('att... | [
"def",
"clone",
"(",
"self",
",",
"*",
"*",
"keywd",
")",
":",
"return",
"argument_t",
"(",
"name",
"=",
"keywd",
".",
"get",
"(",
"'name'",
",",
"self",
".",
"name",
")",
",",
"decl_type",
"=",
"keywd",
".",
"get",
"(",
"'decl_type'",
",",
"self",... | constructs new argument_t instance
return argument_t(
name=keywd.get('name', self.name),
decl_type=keywd.get('decl_type', self.decl_type),
default_value=keywd.get('default_value', self.default_value),
attributes=keywd.get('attributes', self.attributes )) | [
"constructs",
"new",
"argument_t",
"instance"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/calldef.py#L44-L58 |
3,294 | gccxml/pygccxml | pygccxml/declarations/calldef.py | calldef_t.required_args | def required_args(self):
"""list of all required arguments"""
r_args = []
for arg in self.arguments:
if not arg.default_value:
r_args.append(arg)
else:
break
return r_args | python | def required_args(self):
"""list of all required arguments"""
r_args = []
for arg in self.arguments:
if not arg.default_value:
r_args.append(arg)
else:
break
return r_args | [
"def",
"required_args",
"(",
"self",
")",
":",
"r_args",
"=",
"[",
"]",
"for",
"arg",
"in",
"self",
".",
"arguments",
":",
"if",
"not",
"arg",
".",
"default_value",
":",
"r_args",
".",
"append",
"(",
"arg",
")",
"else",
":",
"break",
"return",
"r_arg... | list of all required arguments | [
"list",
"of",
"all",
"required",
"arguments"
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/calldef.py#L224-L232 |
3,295 | gccxml/pygccxml | pygccxml/declarations/calldef.py | calldef_t.overloads | def overloads(self):
"""A list of overloaded "callables" (i.e. other callables with the
same name within the same scope.
@type: list of :class:`calldef_t`
"""
if not self.parent:
return []
# finding all functions with the same name
return self.parent.... | python | def overloads(self):
"""A list of overloaded "callables" (i.e. other callables with the
same name within the same scope.
@type: list of :class:`calldef_t`
"""
if not self.parent:
return []
# finding all functions with the same name
return self.parent.... | [
"def",
"overloads",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"parent",
":",
"return",
"[",
"]",
"# finding all functions with the same name",
"return",
"self",
".",
"parent",
".",
"calldefs",
"(",
"name",
"=",
"self",
".",
"name",
",",
"function",
... | A list of overloaded "callables" (i.e. other callables with the
same name within the same scope.
@type: list of :class:`calldef_t` | [
"A",
"list",
"of",
"overloaded",
"callables",
"(",
"i",
".",
"e",
".",
"other",
"callables",
"with",
"the",
"same",
"name",
"within",
"the",
"same",
"scope",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/declarations/calldef.py#L273-L286 |
3,296 | gccxml/pygccxml | pygccxml/parser/declarations_cache.py | file_signature | def file_signature(filename):
"""
Return a signature for a file.
"""
if not os.path.isfile(filename):
return None
if not os.path.exists(filename):
return None
# Duplicate auto-generated files can be recognized with the sha1 hash.
sig = hashlib.sha1()
with open(filename... | python | def file_signature(filename):
"""
Return a signature for a file.
"""
if not os.path.isfile(filename):
return None
if not os.path.exists(filename):
return None
# Duplicate auto-generated files can be recognized with the sha1 hash.
sig = hashlib.sha1()
with open(filename... | [
"def",
"file_signature",
"(",
"filename",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"filename",
")",
":",
"return",
"None",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"filename",
")",
":",
"return",
"None",
"# Duplicate aut... | Return a signature for a file. | [
"Return",
"a",
"signature",
"for",
"a",
"file",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/parser/declarations_cache.py#L17-L34 |
3,297 | gccxml/pygccxml | pygccxml/parser/declarations_cache.py | file_cache_t.__load | def __load(file_name):
""" Load pickled cache from file and return the object. """
if os.path.exists(file_name) and not os.path.isfile(file_name):
raise RuntimeError(
'Cache should be initialized with valid full file name')
if not os.path.exists(file_name):
... | python | def __load(file_name):
""" Load pickled cache from file and return the object. """
if os.path.exists(file_name) and not os.path.isfile(file_name):
raise RuntimeError(
'Cache should be initialized with valid full file name')
if not os.path.exists(file_name):
... | [
"def",
"__load",
"(",
"file_name",
")",
":",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"file_name",
")",
"and",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"file_name",
")",
":",
"raise",
"RuntimeError",
"(",
"'Cache should be initialized with valid ful... | Load pickled cache from file and return the object. | [
"Load",
"pickled",
"cache",
"from",
"file",
"and",
"return",
"the",
"object",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/parser/declarations_cache.py#L179-L212 |
3,298 | gccxml/pygccxml | pygccxml/parser/declarations_cache.py | file_cache_t.update | def update(self, source_file, configuration, declarations, included_files):
""" Update a cached record with the current key and value contents. """
record = record_t(
source_signature=file_signature(source_file),
config_signature=configuration_signature(configuration),
... | python | def update(self, source_file, configuration, declarations, included_files):
""" Update a cached record with the current key and value contents. """
record = record_t(
source_signature=file_signature(source_file),
config_signature=configuration_signature(configuration),
... | [
"def",
"update",
"(",
"self",
",",
"source_file",
",",
"configuration",
",",
"declarations",
",",
"included_files",
")",
":",
"record",
"=",
"record_t",
"(",
"source_signature",
"=",
"file_signature",
"(",
"source_file",
")",
",",
"config_signature",
"=",
"confi... | Update a cached record with the current key and value contents. | [
"Update",
"a",
"cached",
"record",
"with",
"the",
"current",
"key",
"and",
"value",
"contents",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/parser/declarations_cache.py#L234-L250 |
3,299 | gccxml/pygccxml | pygccxml/parser/declarations_cache.py | file_cache_t.cached_value | def cached_value(self, source_file, configuration):
"""
Attempt to lookup the cached declarations for the given file and
configuration.
Returns None if declaration not found or signature check fails.
"""
key = record_t.create_key(source_file, configuration)
if ... | python | def cached_value(self, source_file, configuration):
"""
Attempt to lookup the cached declarations for the given file and
configuration.
Returns None if declaration not found or signature check fails.
"""
key = record_t.create_key(source_file, configuration)
if ... | [
"def",
"cached_value",
"(",
"self",
",",
"source_file",
",",
"configuration",
")",
":",
"key",
"=",
"record_t",
".",
"create_key",
"(",
"source_file",
",",
"configuration",
")",
"if",
"key",
"not",
"in",
"self",
".",
"__cache",
":",
"return",
"None",
"reco... | Attempt to lookup the cached declarations for the given file and
configuration.
Returns None if declaration not found or signature check fails. | [
"Attempt",
"to",
"lookup",
"the",
"cached",
"declarations",
"for",
"the",
"given",
"file",
"and",
"configuration",
"."
] | 2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e | https://github.com/gccxml/pygccxml/blob/2b1efbb9e37ceb2ae925c7f3ce1570f476db9e1e/pygccxml/parser/declarations_cache.py#L252-L271 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.