Source: LiloFile.h


Annotated List
Files
Globals
Hierarchy
Index
/**
 * File:
 *   LiloFile.h
 *
 * Module:
 *   lilo.conf agent
 *
 * Summary:
 *   lilo file internal representation
 *
 * Authors:
 *   dan.meszaros 
 *
 * $Id: LiloFile.h,v 1.1.1.1 2002/06/27 12:46:35 lslezak Exp $
 *
 * lilo.conf file memory representation base class
 *
 */

#ifndef __LILOFILE
#define __LILOFILE

#include 
#include 
#include "LiloSection.h"

/**
 * lilo.conf file memory representation base class
 */

class liloFile
{
public:
    /**
     *  path to lilo.conf file
     */
    string fname;

    /**
     *  lilo.conf global comment (global comment is separated from first option comment by empty line)
     */
    string comment;

    /**
     *  object that holds information about the options order and their value and comments
     */
    liloOrderedOptions options;
    
    /**
     *  sections of lilo.conf file
     */
    vector sections;

    /**
     *	does nothing but sets the path to lilo.conf file
     */

	liloFile(string filename);

    /**
     *  
     */
	~liloFile();

    /**
     *  loads and parses the file. returns false on failure
     */ 
    bool parse();

    /** 
     *  saves the memory structure to disk. returns false on failure
     */
    bool save(const char* filename=NULL);

    /**
     * discards changes and reread the lilo.conf file again
     */
    bool reread();

    /** 
     * dumps debug info to file
     */
    void dump(FILE* f);

    /**
     * returns pointer to section that coresponds with the path and section name
     * (eg. for .lilo.image, "vmlinuz" returns pointer to section from imageSections 
     * that matches the "vmlinuz" section name)
     */
    liloSection* getSectPtr(const YCPPath& path);

    /**
     * writing to internal datastructure / writing structure to file
     */
    YCPValue Write(const YCPPath &path, const YCPValue& value, const YCPValue& arg);

    /**
     * reading from internal data structure
     */    
    YCPValue Read(const YCPPath &path, const YCPValue& arg);

    /**
     *	Dir from internal data structure
     */
    YCPValue Dir(const YCPPath& path);

    /**
     *	returns corresponding section vector from the given path
     */
    vector* getVectByName(const YCPPath& path);
    
    /**
     *  returns position in of section given section name and section's vector
     */
    int getSectPos(string sectname);
};

#endif

Generated by: root on D63 on Tue Sep 24 20:20:08 2002, using kdoc 2.0a54.