Vala.SourceFile – vala Reference Manual
Packages
vala
Vala
SourceFile
content
context
current_using_directives
file_type
filename
from_commandline
gir_ambiguous
gir_namespace
gir_version
installed_version
package_name
relative_filename
used
SourceFile
accept
accept_children
add_comment
add_node
add_using_directive
check
get_basename
get_cinclude_filename
get_comments
get_csource_filename
get_destination_directory
get_mapped_contents
get_mapped_length
get_nodes
get_relative_filename
get_source_line
get_subdir
read_source_file
read_source_lines
remove_node
_content
_context
_current_using_directives
_file_type
_filename
_from_commandline
_gir_ambiguous
_gir_namespace
_gir_version
_installed_version
_package_name
_relative_filename
_used
_version_requested
cinclude_filename
comments
csource_filename
mapped_file
nodes
source_array
SourceFile
Object Hierarchy:
Vala.SourceFile
Vala.SourceFile
Vala.SourceFile
Description:
public
class
SourceFile
Represents a Vala source or VAPI package file.
Namespace:
Vala
Package:
vala
Content:
Properties:
public
string
?
content
{
get
;
set
; }
public
unowned
CodeContext
context
{
get
;
set
; }
The context this source file belongs to.
public
List
<
UsingDirective
>
current_using_directives
{
get
;
set
; }
public
SourceFileType
file_type
{
get
;
set
; }
Specifies whether this file is a VAPI package file.
public
string
filename
{
get
;
private
set
; }
The name of this source file.
public
bool
from_commandline
{
get
;
set
; }
Specifies whether this file came from the command line directly.
public
bool
gir_ambiguous
{
get
;
set
; }
public
string
gir_namespace
{
get
;
set
; }
GIR Namespace for this source file, if it's a VAPI package
public
string
gir_version
{
get
;
set
; }
GIR Namespace version for this source file, if it's a VAPI package
public
string
?
installed_version
{
get
;
set
; }
The installed package version or null
public
string
?
package_name
{
get
;
set
; }
public
string
?
relative_filename
{
set
; }
public
bool
used
{
get
;
set
; }
If the file has been used (ie: if anything in the file has been emitted into C code as a definition or declaration).
Creation methods:
public
SourceFile
(
CodeContext
context,
SourceFileType
type,
string
filename,
string
? content =
null
,
bool
cmdline =
false
)
Creates a new source file.
Methods:
public
void
accept
(
CodeVisitor
visitor)
public
void
accept_children
(
CodeVisitor
visitor)
public
void
add_comment
(
Comment
comment)
Adds a header comment to this source file.
public
void
add_node
(
CodeNode
node)
Adds the specified code node to this source file.
public
void
add_using_directive
(
UsingDirective
ns)
Adds a new using directive with the specified namespace.
public
bool
check
(
CodeContext
context)
private
string
get_basename
()
public
string
get_cinclude_filename
()
Returns the filename to use when including the generated C header file.
public
unowned
List
<
Comment
>
get_comments
()
Returns the list of header comments.
public
string
get_csource_filename
()
Returns the filename to use when generating C source files.
private
string
get_destination_directory
()
public
char
*
get_mapped_contents
()
public
size_t
get_mapped_length
()
public
unowned
List
<
CodeNode
>
get_nodes
()
Returns the list of code nodes.
public
string
get_relative_filename
()
public
string
?
get_source_line
(
int
lineno)
Returns the requested line from this file, loading it if needed.
private
string
get_subdir
()
private
void
read_source_file
()
Parses the input file into ::source_array.
private
void
read_source_lines
(
string
cont)
public
void
remove_node
(
CodeNode
node)
Fields:
private
string
?
_content
private
unowned
CodeContext
_context
private
List
<
UsingDirective
>
_current_using_directives
private
SourceFileType
_file_type
private
string
_filename
private
bool
_from_commandline
private
bool
_gir_ambiguous
private
string
_gir_namespace
private
string
_gir_version
private
string
?
_installed_version
private
string
_package_name
private
string
?
_relative_filename
private
bool
_used
private
bool
_version_requested
private
string
cinclude_filename
private
ArrayList
<
Comment
>
comments
private
string
csource_filename
private
MappedFile
mapped_file
private
List
<
CodeNode
>
nodes
private
ArrayList
<
string
>
source_array