50 lines
769 B
C
50 lines
769 B
C
|
/*
|
||
|
* This file is a part of CMSLU -- Content Management System like Unix
|
||
|
* and is not publicly distributed
|
||
|
*
|
||
|
* Copyright (c) 2009, Tomasz Sowa
|
||
|
* All rights reserved.
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
#ifndef headerfilecoremountparser
|
||
|
#define headerfilecoremountparser
|
||
|
|
||
|
#include <map>
|
||
|
#include <string>
|
||
|
|
||
|
#include "log.h"
|
||
|
#include "mount.h"
|
||
|
#include "error.h"
|
||
|
#include "item.h"
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
class MountParser
|
||
|
{
|
||
|
public:
|
||
|
|
||
|
Error Parse(const std::string & input, std::map<long, Mount> & output);
|
||
|
|
||
|
|
||
|
private:
|
||
|
|
||
|
bool IsWhite(int c);
|
||
|
void SkipWhite();
|
||
|
void SkipLine();
|
||
|
void ReadWord(std::string & res);
|
||
|
void ReadMountType();
|
||
|
void ReadMountPoint();
|
||
|
void ReadRow(std::map<long, Mount> & output);
|
||
|
|
||
|
const char * pinput;
|
||
|
std::string temp;
|
||
|
Mount::Type mount_type;
|
||
|
Item * pdir;
|
||
|
Error err;
|
||
|
};
|
||
|
|
||
|
|
||
|
#endif
|