Browse Source

cleanup

tags/1.0.0
Chris Cromer 10 months ago
parent
commit
9c5c7f1e7d
Signed by: Chris Cromer <chris@cromer.cl> GPG Key ID: 39CC813FF3C8708A
15 changed files with 222 additions and 488 deletions
  1. +0
    -14
      build_linux_package.sh
  2. +0
    -1
      data/etc/meson.build
  3. +0
    -9
      data/etc/sernatur.conf
  4. +35
    -0
      data/gschema/cl.cromer.ubb.sernatur.gschema.xml
  5. +0
    -1
      data/meson.build
  6. +170
    -167
      data/ui/sernatur.window.ui
  7. +0
    -1
      doc/meson.build
  8. +0
    -4
      meson_options.txt
  9. +0
    -15
      script/linux_bundler.sh
  10. +0
    -5
      script/meson.build
  11. +0
    -7
      script/sernatur.sh
  12. +1
    -5
      src/meson.build
  13. +8
    -35
      src/sernatur-window.vala
  14. +8
    -0
      src/sernatur.vala
  15. +0
    -224
      src/vapi/libconfig.vapi

+ 0
- 14
build_linux_package.sh View File

@@ -1,14 +0,0 @@
#!/bin/sh -eu

curdir=`pwd`
rm -rf buildtmp
mkdir buildtmp
LDFLAGS=-static-libstdc++ meson buildtmp -D bundle_libs=false -D valadocs_deps=false --buildtype=release --prefix=/tmp/sernatur --libdir=lib --strip
ninja -C buildtmp install
rm -rf buildtmp
cp README.md /tmp/sernatur
cp LICENSE /tmp/sernatur
cd /tmp/
tar czf sernatur.tar.gz sernatur
mv sernatur.tar.gz "$curdir"
rm -rf sernatur

+ 0
- 1
data/etc/meson.build View File

@@ -1 +0,0 @@
install_data('sernatur.conf', install_dir: join_paths(get_option('prefix'), get_option('sysconfdir'), 'sernatur'))

+ 0
- 9
data/etc/sernatur.conf View File

@@ -1,9 +0,0 @@
database : {
host = "localhost";
port = 5432;
options = "";
gtty = "";
db_name = "bdd";
login = "bdd";
pwd = "bdd";
};

+ 35
- 0
data/gschema/cl.cromer.ubb.sernatur.gschema.xml View File

@@ -14,5 +14,40 @@
Port number to use
</description>
</key>
<key name="options" type="s">
<default>""</default>
<summary>Options to use</summary>
<description>
Options to use
</description>
</key>
<key name="tty" type="s">
<default>""</default>
<summary>tty to send debug info (ignored)</summary>
<description>
tty to send debug info (ignored)
</description>
</key>
<key name="database" type="s">
<default>"bdd"</default>
<summary>Database to use</summary>
<description>
Database to use
</description>
</key>
<key name="username" type="s">
<default>"bdd"</default>
<summary>Username to use</summary>
<description>
Username to use
</description>
</key>
<key name="password" type="s">
<default>"bdd"</default>
<summary>Password to use</summary>
<description>
Password to use
</description>
</key>
</schema>
</schemalist>

+ 0
- 1
data/meson.build View File

@@ -1,5 +1,4 @@
subdir('ui')
subdir('etc')
subdir('gschema')
subdir('desktop')
subdir('icons')

+ 170
- 167
data/ui/sernatur.window.ui View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1
<!-- Generated with glade 3.22.1

Copyright 2018 Chris Cromer

@@ -17,185 +17,188 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
<interface>
<requires lib="gtk+" version="3.10"/>
<template class="SernaturMainWindow" parent="GtkApplicationWindow">
<property name="can_focus">False</property>
<property name="title">SERNATUR</property>
<property name="icon_name">sernatur</property>
<property name="show_menubar">False</property>
<child>
<object class="GtkBox" id="mainbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="title">SERNATUR</property>
<property name="icon_name">sernatur</property>
<property name="show_menubar">False</property>
<child>
<object class="GtkMenuBar" id="menubar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkMenuItem">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_File</property>
<property name="use_underline">True</property>
<child type="submenu">
<object class="GtkMenu">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-new</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-open</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-save</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-save-as</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-quit</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkMenuItem">
<placeholder/>
</child>
<child>
<object class="GtkBox" id="mainbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Edit</property>
<property name="use_underline">True</property>
<child type="submenu">
<object class="GtkMenu">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-cut</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-copy</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-paste</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-delete</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkMenuBar" id="menubar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<child>
<object class="GtkMenuItem">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_File</property>
<property name="use_underline">True</property>
<child type="submenu">
<object class="GtkMenu">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-new</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-open</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-save</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-save-as</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-quit</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkMenuItem">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Edit</property>
<property name="use_underline">True</property>
<child type="submenu">
<object class="GtkMenu">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-cut</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-copy</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-paste</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-delete</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkMenuItem">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_View</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkMenuItem">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Help</property>
<property name="use_underline">True</property>
<child type="submenu">
<object class="GtkMenu">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-about</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
<child>
<object class="GtkMenuItem">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_View</property>
<property name="use_underline">True</property>
</object>
</child>
<child>
<object class="GtkMenuItem">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Help</property>
<property name="use_underline">True</property>
<child type="submenu">
<object class="GtkMenu">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkImageMenuItem">
<property name="label">gtk-about</property>
<child>
<object class="GtkImage" id="logo">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
</object>
</child>
<property name="resource">/cl/cromer/ubb/sernatur/pixdata/logo-sernatur.svg</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkImage" id="logo">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="resource">/cl/cromer/ubb/sernatur/pixdata/logo-sernatur.svg</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</template>
</interface>

+ 0
- 1
doc/meson.build View File

@@ -5,7 +5,6 @@ if docs_enabled
valadocs_deps = get_option('valadocs_deps')
docs_deps = ['--pkg=gtk+-3.0']
docs_deps += ['--pkg=libpq']
docs_deps += ['--pkg=libconfig']
docs_deps += ['--pkg=posix']
if valadocs_deps
docs_deps += ['--deps']

+ 0
- 4
meson_options.txt View File

@@ -6,10 +6,6 @@ option('valadocs_deps',
type: 'boolean',
value: false,
description: 'Build the valadocs of the deps of sernatur')
option('bundle_libs',
type: 'boolean',
value: false,
description: 'Bundle the libs that the executable is linked against')
option('install_translations',
type: 'boolean',
value: true,

+ 0
- 15
script/linux_bundler.sh View File

@@ -1,15 +0,0 @@
#!/bin/sh -eu

libdir="${MESON_INSTALL_DESTDIR_PREFIX}/lib"
mkdir -p $libdir

#libfile=`ldd ${MESON_INSTALL_DESTDIR_PREFIX}/bin/sernatur | grep libpq | cut -d ' ' -f 3`
#cp $libfile "${libdir}"
#strip "${libdir}/libpq"*

if [ -f "${MESON_INSTALL_DESTDIR_PREFIX}"/bin/sernatur ]; then
echo "Copying linked dynamic libs..."
ldd "${MESON_INSTALL_DESTDIR_PREFIX}"/bin/sernatur | grep "=> /" | awk '{print $3}' | xargs -I '{}' cp -v '{}' "${libdir}"
fi
echo "Stripping libs..."
strip --strip-debug "${libdir}/"*

+ 0
- 5
script/meson.build View File

@@ -1,7 +1,2 @@
bundle_libs = get_option('bundle_libs')
if bundle_libs
install_data('sernatur.sh', install_dir: '.')
meson.add_install_script('linux_bundler.sh')
endif
valadoc = find_program('glib-compile-schemas')
meson.add_install_script('compile_schemas.sh')

+ 0
- 7
script/sernatur.sh View File

@@ -1,7 +0,0 @@
#!/bin/bash

cd "${0%/*}"

export LD_LIBRARY_PATH="`pwd`/lib"
export GSETTINGS_SCHEMA_DIR="`pwd`/share/glib-2.0/schemas"
bin/sernatur

+ 1
- 5
src/meson.build View File

@@ -6,10 +6,6 @@ gmodule_dep = dependency('gmodule-2.0', version: '>=2.0')
pq_dep = dependency('libpq', version: '>=10.0')
posix_dep = meson.get_compiler('vala').find_library('posix')

libconfig_lib = meson.get_compiler('c').find_library('libconfig')
libconfig_vapi = meson.get_compiler('vala').find_library('libconfig', dirs: join_paths(meson.current_source_dir(), 'vapi'))
libconfig_dep = declare_dependency(dependencies: [libconfig_lib, libconfig_vapi], version: '1.5')

# this is how to link against a c lib
#libsystemd_lib = meson.get_compiler('c').find_library('libsystemd')

@@ -39,5 +35,5 @@ vala_args += ['--gresources='+join_paths(meson.source_root(),'data/ui/sernatur.g
exe = executable('sernatur',
sources,
vala_args: vala_args,
dependencies: [glib_dep, gobject_dep, gtk_dep, gmodule_dep, pq_dep, libconfig_dep, posix_dep],
dependencies: [glib_dep, gobject_dep, gtk_dep, gmodule_dep, pq_dep, posix_dep],
install: true)

+ 8
- 35
src/sernatur-window.vala View File

@@ -17,7 +17,6 @@
*/
namespace Sernatur {
using Postgres;
using LibConfig;

/**
* The MainWindow class
@@ -33,42 +32,16 @@ namespace Sernatur {
GLib.Object (application: application);
Database conn;

var file = File.new_for_path ("/etc/sernatur/sernatur.conf");
if (!file.query_exists ()) {
stderr.printf (dgettext (null, "The file '%s' doesn't exist.\n"), file.get_path ());
application.quit ();
return;
}

// TODO: if config file does not exist, then fallback to gsettings schemas

Config config = Config();
if (!config.read_file ("/etc/sernatur/sernatur.conf")) {
stderr.printf ("%s\n", config.error_message ());
application.quit ();
return;
}

Setting setting = config.lookup("database");
string* host;
int port;
string* options;
string* gtty;
string* db_name;
string* login;
string* pwd;
setting.lookup_string("host", out host);
setting.lookup_int("port", out port);
setting.lookup_string("options", out options);
setting.lookup_string("gtty", out gtty);
setting.lookup_string("db_name", out db_name);
setting.lookup_string("login", out login);
setting.lookup_string("pwd", out pwd);

Settings settings = new Settings ("cl.cromer.ubb.sernatur");
var host2 = settings.get_string ("host");
string host = settings.get_string ("host");
string port = settings.get_string ("port");
string options = settings.get_string ("options");
string tty = settings.get_string ("tty");
string database = settings.get_string ("database");
string username = settings.get_string ("username");
string password = settings.get_string ("password");

conn = set_db_login (host2, port.to_string (), options, gtty, db_name, login, pwd);
conn = set_db_login (host, port, options, tty, database, username, password);
if (conn.get_status () != ConnectionStatus.OK) {
stderr.printf ("%s\n", conn.get_error_message ());
Gtk.MessageDialog msg = new Gtk.MessageDialog (this,

+ 8
- 0
src/sernatur.vala View File

@@ -16,6 +16,8 @@
* The main Sernatur namespace
*/
namespace Sernatur {
using Gtk;

/**
* The application class
*/
@@ -38,6 +40,12 @@ namespace Sernatur {
public override void activate () {
window = new MainWindow (this);
//window.maximize ();
try {
window.icon = IconTheme.get_default ().load_icon ("sernatur", 48, 0);
}
catch (Error e) {
stderr.printf ("Could not load application icon: %s\n", e.message);
}
window.present ();
}


+ 0
- 224
src/vapi/libconfig.vapi View File

@@ -1,224 +0,0 @@
/*
* Copyright 2018 Chris Cromer
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

[CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "libconfig.h")]
namespace LibConfig {
using Posix; // Needed for Posix.FILE

[CCode (cname = "uint", cprefix = "LIBCONFIG_VER_", has_type_id = false)]
public enum Version {
MAJOR,
MINOR,
REVISION;
/**
* Convert the enum value into a string with a version number
* This method is here to override default enum to_string which will print the enum variable name by default
* @return string with version number
*/
public string to_string () {
int x_value = this;
return x_value.to_string();
}
}

[CCode (cname = "int", cprefix = "CONFIG_ERR_", has_type_id = false)]
public enum ConfigError {
NONE = 0,
FILE_IO = 1,
PARSE = 2
}

[CCode (cname = "int", cprefix = "CONFIG_OPTION_", has_type_id = false)]
[Flags]
public enum ConfigOption {
AUTOCONVERT = 0x01,
SEMICOLON_SEPARATORS = 0x02,
COLON_ASSIGNMENT_FOR_GROUPS = 0x04,
COLON_ASSIGNMENT_FOR_NON_GROUPS = 0x08,
OPEN_BRACE_ON_SEPARATE_LINE = 0x10,
[Version (since = "1.7")]
ALLOW_SCIENTIFIC_NOTATION = 0x20,
[Version (since = "1.7.1")]
FSYNC = 0x40
}

[CCode (cname = "int", cprefix = "CONFIG_TYPE_", has_type_id = false)]
public enum ConfigType {
NONE = 0,
GROUP = 1,
INT = 2,
INT64 = 3,
FLOAT = 4,
STRING = 5,
BOOL = 6,
ARRAY = 7,
LIST = 8
}

[CCode (cname = "int", cprefix = "CONFIG_FORMAT_", has_type_id = false)]
public enum ConfigFormat {
DEFAULT = 0,
HEX = 1
}

[CCode (cname = "config_t", cprefix = "config_", destroy_function = "config_destroy", has_type_id = false)]
public struct Config {
[CCode (cname = "config_init")]
public Config();

[Version (since = "1.7")]
public void clear ();

public bool read (FILE stream);
public bool read_file (string filename);
public bool read_string (string str);

public void write (FILE stream);
public bool write_file (string filename);

public void set_include_dir (string include_dir);
public string get_include_dir ();

//[Version (since = "1.7")]
//void config_set_include_func (config_include_fn_t func)

[Version (since = "1.6")]
public ushort get_float_precision ();
[Version (since = "1.6")]
public void set_float_precision (ushort digits);

public ConfigOption get_options ();
public void set_options (ConfigOption options);

[Version (since = "1.7")]
public ConfigOption get_option (int option);
[Version (since = "1.7")]
public void set_option (ConfigOption option, int flag);

[Version (deprecated = true, replacement = "get_option")]
public int get_auto_convert ();
[Version (deprecated = true, replacement = "set_option")]
public void set_auto_convert (int flag);

public ConfigFormat get_default_format ();
public void set_default_format (ConfigFormat format);

public ushort get_tab_width ();
public void set_tab_width (ushort width);

public bool lookup_int (string path, out int x_value);
public bool lookup_int64 (string path, out int64 x_value);
public bool lookup_float (string path, out float x_value);
public bool lookup_bool (string path, out bool x_value);
public bool lookup_string (string path, out string x_value);

public Setting? lookup (string path);

public Setting root_setting ();

[CCode (simple_generics = true)]
[Version (since = "1.7")]
public void set_hook<T> (T hook);

[CCode (simple_generics = true)]
[Version (since = "1.7")]
public T get_hook<T> ();

//[CCode (simple_generics = true)]
//public void set_destructor<T> (T void (* destructor));

public unowned string error_text ();
public unowned string? error_file ();
public int error_line ();
public ConfigError error_type ();

public string error_message () {
return this.error_file () + ":" + this.error_line ().to_string() + " - " + this.error_text ();
}

public string version() {
return Version.MAJOR.to_string () + "." + Version.MINOR.to_string () + "." + Version.REVISION.to_string ();
}
}

[CCode (cname = "config_setting_t", cprefix = "config_setting_", free_function = "", has_type_id = false, has_target = false)]
[Compact]
public class Setting {
public Setting? lookup (string path);

public int? get_int ();
public int64? get_int64 ();
public float? get_float ();
public bool? get_bool ();
public unowned string? get_string ();

public bool set_int (int x_value);
public bool set_int64 (int64 x_value);
public bool set_float (float x_value);
public bool set_bool (bool x_value);
public bool set_string (string x_value);

public bool lookup_int (string name, out int x_value);
public bool lookup_int64 (string name, out int64 x_value);
public bool lookup_float (string name, out float x_value);
public bool lookup_bool (string name, out bool x_value);
public bool lookup_string (string name, out string x_value);

public ConfigFormat get_format ();
public bool set_format (ConfigFormat format);

public Setting? get_member (string name);

public Setting? get_elem (uint index);

public int? get_int_elem (int index);
public int64? get_int64_elem (int index);
public float? get_float_elem (int index);
public bool? get_bool_elem (int index);
public unowned string? get_string_elem (int index);

public Setting? set_int_elem (int index, int x_value);
public Setting? set_int64_elem (int index, int64 x_value);
public Setting? set_float_elem (int index, float x_value);
public Setting? set_bool_elem (int index, bool x_value);
public Setting? set_string_elem (int index, string x_value);

public Setting? add (Setting parent, string? name, ConfigType type);
public bool remove (Setting parent, string name);
public int remove_elem (Setting parent, uint index);

public unowned string? name ();
public Setting? parent ();

public bool is_root ();

public int index ();

public int length ();

public ConfigType type ();

public bool is_group ();
public bool is_array ();
public bool is_list ();

public bool is_aggregate ();
public bool is_scalar ();
public bool is_number ();

public unowned string? source_file ();

public uint source_line ();
}
}

Loading…
Cancel
Save