00001 /* 00002 * BEEN: Benchmarking Environment 00003 * ============================== 00004 * 00005 * File author: Branislav Repcek 00006 * 00007 * GNU Lesser General Public License Version 2.1 00008 * --------------------------------------------- 00009 * Copyright (C) 2004-2006 Distributed Systems Research Group, 00010 * Faculty of Mathematics and Physics, Charles University in Prague 00011 * 00012 * This library is free software; you can redistribute it and/or 00013 * modify it under the terms of the GNU Lesser General Public 00014 * License version 2.1, as published by the Free Software Foundation. 00015 * 00016 * This library is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 * Lesser General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU Lesser General Public 00022 * License along with this library; if not, write to the Free Software 00023 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 00024 * MA 02111-1307 USA 00025 */ 00026 00034 #ifndef GENTOO_FIND_PACKAGER 00035 #define GENTOO_FIND_PACKAGER 00036 00037 #include <stdio.h> 00038 #include "../common/MessageReporter.h" 00039 #include "../common/XMLFileOutput.h" 00040 #include "Packager.h" 00041 #include "ForkAndPipe.h" 00042 00043 namespace hwdet 00044 { 00050 class GentooFindPackager : public Packager 00051 { 00052 public: 00054 GentooFindPackager(MessageReporter *parent_reporter); 00055 00057 virtual ~GentooFindPackager(void); 00058 00060 virtual bool IsSupported(void); 00061 00063 virtual bool DetectSoftware(XMLElement *products); 00064 00065 private: 00066 00069 class FindExec : public ForkAndPipe 00070 { 00071 public: 00073 FindExec(MessageReporter *parent_reporter, XMLElement *output); 00074 00076 virtual ~FindExec(void); 00077 00079 virtual void ParentProcess(pid_t child_pid, FILE *file); 00080 00082 virtual void ChildProcess(void); 00083 00084 private: 00086 XMLElement *output_node; 00087 }; 00088 00090 bool is_supported; 00091 }; 00092 } 00093 00094 #endif