69 lines
1.3 KiB
C++
Executable File
69 lines
1.3 KiB
C++
Executable File
/*
|
|
* This file is a part of Winix
|
|
* and is not publicly distributed
|
|
*
|
|
* Copyright (c) 2010, 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"
|
|
#include "dirs.h"
|
|
|
|
|
|
|
|
class MountParser
|
|
{
|
|
public:
|
|
|
|
Error Parse(const std::string & input, std::map<long, Mount> & output);
|
|
void SetDirs(Dirs * pdirs);
|
|
|
|
private:
|
|
|
|
Dirs * dirs;
|
|
|
|
bool IsWhite(int c);
|
|
void SkipWhite();
|
|
void SkipLine();
|
|
void ReadWordQuote(std::string & res);
|
|
void ReadWordWhite(std::string & res);
|
|
void ReadWordComma(std::string & res);
|
|
void ReadWord(std::string & res, bool comma_bracket_separator = false);
|
|
void ReadParamArgsLoop(Mount::ParamArg & args);
|
|
void ReadParamArgs(Mount::ParamArg & args);
|
|
void ReadParamName(std::string & res);
|
|
void ReadParam(std::string & res, Mount::ParamArg & args);
|
|
void ReadMountType();
|
|
void ReadMountPoint();
|
|
void ReadFs();
|
|
void LogMountParams();
|
|
void ReadMountParams();
|
|
void ReadRow(std::map<long, Mount> & output);
|
|
|
|
const char * pinput;
|
|
std::string temp;
|
|
std::string temp_arg;
|
|
Mount::ParamArg param_args;
|
|
|
|
|
|
Mount mount;
|
|
|
|
Item * pdir;
|
|
Error err;
|
|
};
|
|
|
|
|
|
#endif
|