/* project.vala * * Copyright (C) 2008 Nicolas Joseph * * 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 3 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Author: * Nicolas Joseph */ using GLib; public class Valide.Project : GLib.Object { public GLib.List files; public string[] compiler_opt; private string name_; private string path_; public string path { get { return this.path_; } set { /** * @bug[valac] Undeclared inner_error in C source. */ GLib.Error inner_error = null; try { MarkupDomNode node = MarkupDom.load (value); this.name = node.attributs.lookup ("name"); node = node.get_element_by_name ("file"); for (;node != null; node = node.next) { files.append (node.content); } this.path_ = GLib.Path.get_dirname (value); } catch (GLib.Error e) { GLib.critical (e.message); } } } public string name { get { return this.name_; } set { this.name_ = value; } } public Project (string! path) { this.path = path; } public void save () { } public void save_as () { } public bool close () { return true; } public void open_file (string! filename) { DocumentFactory.get_instance () .create (GLib.Path.build_filename (this.path, filename, null)); } }