net: tcp_client_socket connection state routines
[quarnos.git] / resources / fs.cpp
blobc779bc48cb199b987efecf88f7018e9faba61e32
1 /* Quarn OS
3 * File system
5 * Copyright (C) 2008-2009 Pawel Dziepak
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #include "fs.h"
24 #include "file.h"
26 using namespace manes;
27 using namespace resources;
29 /* Only for testing */
30 p<manes::cds::component> fs::get_component(const manes::cds::component_name &fname) {
31 if (fname.get_type().get_name() != string("file"))
32 return p<manes::cds::component>::invalid;
34 /* TODO: check if file's object already exist before create new one */
35 p<manes::cds::component> file_comp = new_component(manes::cds::component_name::from_path("/type,file"));
36 p<file> fp = file_comp.cast<file>();
38 /* Till constructor's arguments are supported by manes */
39 fp->set(fname.get_name(), this);
41 /* In the near future component implementation will inherit from component
42 * class. That will be better solution that current aggregations.
44 return file_comp;
47 bool fs::initialize() {
48 return true;