2009-04-20 00:13:21 +02:00
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2009-04-21 22:50:55 +02:00
|
|
|
#ifndef headerfilecmslucoremountparser
|
|
|
|
#define headerfilecmslucoremountparser
|
2009-04-20 00:13:21 +02:00
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "mount.h"
|
|
|
|
#include "item.h"
|
2009-04-21 22:50:55 +02:00
|
|
|
#include "error.h"
|
2009-04-20 00:13:21 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
2009-04-21 01:49:28 +02:00
|
|
|
void ReadParam(std::string & res);
|
2009-04-20 00:13:21 +02:00
|
|
|
void ReadMountType();
|
|
|
|
void ReadMountPoint();
|
2009-04-21 01:49:28 +02:00
|
|
|
void ReadMountParams();
|
2009-04-20 00:13:21 +02:00
|
|
|
void ReadRow(std::map<long, Mount> & output);
|
|
|
|
|
|
|
|
const char * pinput;
|
|
|
|
std::string temp;
|
2009-04-21 01:49:28 +02:00
|
|
|
|
|
|
|
Mount mount;
|
|
|
|
|
2009-04-20 00:13:21 +02:00
|
|
|
Item * pdir;
|
|
|
|
Error err;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|