Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

LiloSection.h

Go to the documentation of this file.
00001 
00020 #ifndef __LILOSECTION
00021 #define __LILOSECTION
00022 
00023 #include <string>
00024 #include <vector>
00025 #include <map>
00026 
00027 #include <Y2.h>
00028 
00029 #include <stdio.h>
00030 #include <iostream>
00031 #include <fstream>
00032 
00033 #include "OptTypes.h"
00034 
00035 using namespace std;
00036 
00037 //extern string type;
00038 
00039 // using std::vector;
00040 // using std::map;
00041 
00042 string strip(string str);
00043 string indentString(string str, string indent); // replaces each occurence of '\n' by param
00044 class liloSection;
00045 
00052 class inputLine {
00053 public:
00054 
00055         // eg. input line is: boot = /dev/hda #comment
00056 
00058     string option;
00060     string value;
00062     string comment;
00064     string type;
00065 
00067     string src;    
00068 
00069     inputLine(const string& line, const string& init_type);
00070     void dump();
00071 };
00072 
00079 class liloOption {
00080 public:
00081     
00082     string optname;
00084     string value;
00086     string comment;
00087     liloOption(string optn, string val, string com="");
00088     void dump();
00089     liloOption() {};
00090 };
00091 
00098 class liloOrderedOptions 
00099 {
00100 public:
00102     vector<liloOption*>         order;
00103    
00105         liloOrderedOptions(const string & type);
00107         bool processLine(inputLine* li);
00109         YCPValue Read(const YCPPath& path);
00111         YCPBoolean Write(const YCPPath& path, const YCPValue& val, const YCPValue& _pos);
00113         YCPList Dir();
00115         void dump(FILE* f);
00116    
00117         // CHANGED 
00119         int saveToFile(ostream* f, string indent="");
00121         string type;
00123         OptTypes o;
00124 };
00125 
00126 
00127 enum {
00128     SECT_IMAGE = 0,
00129     SECT_OTHER 
00130 };
00131 
00138 class liloSection {
00139 public:
00141     liloOrderedOptions  *options;
00142 
00144     string sectName;        
00146     string sectComment;
00147 
00149     int sectType; 
00150 
00152         liloSection(const string& init_type);
00153 
00154         virtual ~liloSection();
00155 
00157     virtual bool    processLine(inputLine* line);
00158     
00160     string getSectName();
00161 
00162         // CHANGED
00164     int saveToFile(ostream* f, string indent="");
00165 
00167     virtual YCPValue Read(const YCPPath& path);
00168 
00170     virtual YCPBoolean Write(const YCPPath& path, const YCPValue& val, const YCPValue& pos);
00171 
00172 
00174     virtual YCPList Dir();
00175 
00176     string type;
00177     
00178 };
00179 
00183 string replaceBlanks (const string &s, char r);
00184 
00185 #endif

Generated on Wed Nov 12 03:41:06 2008 for yast2-bootloader by  doxygen 1.3.9.1