CodeContext
Object Hierarchy:
Description:
public class CodeContext
The root of the code tree.
Content:
Properties:
Static methods:
- public static CodeContext @get ()
Return the topmost context from the context stack.
- private static bool ends_with_dir_separator (string s)
- public static void pop ()
Remove the topmost context from the context stack.
- public static void push (CodeContext context)
Push the specified context to the context stack.
- public static string realpath (string name)
Returns canonicalized absolute pathname ported from glibc
Creation methods:
Methods:
- public void accept (CodeVisitor visitor)
Visits the complete code tree file by file. It is possible to add new
source files while visiting the tree.
- public void add_c_source_file (string file)
Adds the specified file to the list of C source files.
- private void add_default_defines ()
- public void add_define (string define)
- public bool add_external_package (string pkg)
Pull the specified package into the context. The method is tolerant if
the package has been already loaded.
- public void add_package (string pkg)
Adds the specified package to the list of used packages.
- public bool add_packages_from_file (string filename)
Read the given filename and pull in packages. The method is tolerant
if the file does not exist.
- public void add_source_file (SourceFile file)
Adds the specified file to the list of source files.
- public bool add_source_filename (string filename, bool is_source = false, bool cmdline = false)
Add the specified source file to the context. Only .vala, .vapi, .gs,
and .c extensions are supported.
- public void check ()
Resolve and analyze.
- public unowned List<string> get_c_source_files ()
Returns the list of C source files.
- private string? get_file_path (string basename, string? versioned_data_dir, string? data_dir, string[] directories)
- public string? get_gir_path (string gir)
- public string? get_gresource_path (string gresource, string resource)
- public string? get_metadata_path (string gir_filename)
- public unowned List<string> get_packages ()
Returns the list of used packages.
- public unowned SourceFile? get_source_file (string filename)
Returns the source file for a given path.
- public unowned List<SourceFile> get_source_files ()
Returns the list of source files.
- public string? get_vapi_path (string pkg)
- public bool has_package (string pkg)
Returns whether the specified package is being used.
- public bool is_defined (string define)
- public string? pkg_config_compile_flags (string package_name)
- public bool pkg_config_exists (string package_name)
- public string? pkg_config_modversion (string package_name)
- public string? pkg_config_variable (string package_name, string variable_name)
- public bool require_glib_version (int major, int minor)
Returns true if the target version of glib is greater than or equal to
the specified version.
- public void set_target_glib_version (string target_glib)
Set the target version of glib for code generation.
- public void set_target_profile (Profile profile, bool include_stdpkg = true)
Set the target profile for code generation.
- public void write_dependencies (string filename)
- private void write_depfile (string filename, List<string> deps)
- public void write_external_dependencies (string filename)
Fields: