[gnome-calculator/60-split-out-a-backend-library: 6/39] gcalc: added ErrorResult and properties to Result
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calculator/60-split-out-a-backend-library: 6/39] gcalc: added ErrorResult and properties to Result
- Date: Fri, 4 Jan 2019 16:34:44 +0000 (UTC)
commit 606d02f1c6c03918dfca93cc95b6909a35b13db0
Author: Daniel Espinosa <esodan gmail com>
Date: Wed Dec 5 18:41:52 2018 -0600
gcalc: added ErrorResult and properties to Result
Preparetions to create equivalent Equation based on Gtk.SourceBuffer
gcalc/gcalc-error-result.vala | 27 +++++++++++++++++++++++++++
gcalc/gcalc-result.vala | 2 ++
gcalc/meson.build | 6 ++++--
3 files changed, 33 insertions(+), 2 deletions(-)
---
diff --git a/gcalc/gcalc-error-result.vala b/gcalc/gcalc-error-result.vala
new file mode 100644
index 00000000..a44ddb80
--- /dev/null
+++ b/gcalc/gcalc-error-result.vala
@@ -0,0 +1,27 @@
+/* gcalc-error-result.vala
+ *
+ * Copyright (C) 2018 Daniel Espinosa <esodan gmail com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors:
+ * Daniel Espinosa <esodan gmail com>
+ */
+public interface GCalc.ErrorResult : Object {
+ public abstract uint start { get; }
+ public abstract uint end { get; }
+ public abstract uint representation_base { get; }
+ public abstract string to_string ();
+}
+
diff --git a/gcalc/gcalc-result.vala b/gcalc/gcalc-result.vala
index 4e99130f..814d6ff9 100644
--- a/gcalc/gcalc-result.vala
+++ b/gcalc/gcalc-result.vala
@@ -21,5 +21,7 @@
public interface GCalc.Result : Object {
public abstract bool is_valid { get; }
public abstract string to_string ();
+ public abstract Number number { get; }
+ public abstract ErrorResult error { get; }
}
diff --git a/gcalc/meson.build b/gcalc/meson.build
index 8b97ff01..fb430539 100644
--- a/gcalc/meson.build
+++ b/gcalc/meson.build
@@ -39,17 +39,19 @@ configure_file(output : 'config.h',
configuration : confh)
sources = files([
- 'gcalc-solver.vala',
- 'gcalc-result.vala',
'gcalc-currency.vala',
'gcalc-equation.vala',
'gcalc-equation-parser.vala',
'gcalc-equation-lexer.vala',
+ 'gcalc-error-result.vala',
'gcalc-function-manager.vala',
+ 'gcalc-math-equation.vala',
'gcalc-math-function.vala',
'gcalc-math-variables.vala',
'gcalc-number.vala',
+ 'gcalc-result.vala',
'gcalc-serializer.vala',
+ 'gcalc-solver.vala',
'gcalc-unit-manager.vala'
])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]