59 lines
1007 B
C++
Executable File
59 lines
1007 B
C++
Executable File
/*
|
|
* 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 headerfilecmslucoremountparser
|
|
#define headerfilecmslucoremountparser
|
|
|
|
#include <map>
|
|
#include <string>
|
|
#include <vector>
|
|
#include <stdlib.h>
|
|
#include <limits.h>
|
|
|
|
#include "mount.h"
|
|
#include "item.h"
|
|
#include "error.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);
|
|
bool ReadParamArg(int & out);
|
|
void ReadParamArgs(std::vector<int> & args);
|
|
void ReadParam(std::string & res, std::vector<int> & args);
|
|
void ReadMountType();
|
|
void ReadMountPoint();
|
|
void ReadMountParams();
|
|
void ReadRow(std::map<long, Mount> & output);
|
|
|
|
const char * pinput;
|
|
std::string temp;
|
|
std::vector<int> param_args;
|
|
|
|
|
|
Mount mount;
|
|
|
|
Item * pdir;
|
|
Error err;
|
|
};
|
|
|
|
|
|
#endif
|