added: forum
added: mount params can have arguments (in parentheses)
added: mount params: withheader, withinfo, restrictcreatethread, only_root_can_remove,
can_use_emacs_on(level), can_use_mkdir_on(level),
added: table Item has 'subject' column now
removed: column 'subject' from table Content
git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@505 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -52,17 +52,77 @@ void MountParser::ReadWord(std::string & res)
|
||||
}
|
||||
|
||||
|
||||
void MountParser::ReadParam(std::string & res)
|
||||
bool MountParser::ReadParamArg(int & out)
|
||||
{
|
||||
res.clear();
|
||||
SkipWhite();
|
||||
|
||||
while( *pinput && *pinput!=10 && *pinput!=',' && !IsWhite(*pinput) )
|
||||
char * new_pos;
|
||||
long temp = strtol(pinput, &new_pos, 10);
|
||||
|
||||
if( pinput == new_pos )
|
||||
return false;
|
||||
|
||||
pinput = new_pos;
|
||||
SkipWhite();
|
||||
|
||||
// here can we make a test whether the temp is greater from 'int' type
|
||||
out = (int)temp;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void MountParser::ReadParamArgs(std::vector<int> & args)
|
||||
{
|
||||
int arg;
|
||||
|
||||
while( ReadParamArg(arg) )
|
||||
{
|
||||
args.push_back(arg);
|
||||
|
||||
log << log3 << "MP: mount param arg: " << arg << logend;
|
||||
|
||||
if( *pinput == ',' )
|
||||
++pinput;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MountParser::ReadParam(std::string & res, std::vector<int> & args)
|
||||
{
|
||||
SkipWhite();
|
||||
res.clear();
|
||||
args.clear();
|
||||
|
||||
while( *pinput && *pinput!=10 && *pinput!=',' && *pinput!='(' && !IsWhite(*pinput) )
|
||||
{
|
||||
res += *pinput;
|
||||
++pinput;
|
||||
}
|
||||
|
||||
if( *pinput==',' )
|
||||
if( res.empty() )
|
||||
return;
|
||||
|
||||
|
||||
// reading arguments
|
||||
SkipWhite();
|
||||
if( *pinput == '(' )
|
||||
{
|
||||
++pinput;
|
||||
ReadParamArgs(args);
|
||||
|
||||
if( *pinput != ')' )
|
||||
{
|
||||
// there should be ')' at the end
|
||||
// temporarily we do nothing
|
||||
}
|
||||
else
|
||||
{
|
||||
++pinput;
|
||||
}
|
||||
}
|
||||
|
||||
if( *pinput == ',' )
|
||||
++pinput;
|
||||
|
||||
}
|
||||
@@ -118,11 +178,11 @@ void MountParser::ReadMountPoint()
|
||||
|
||||
void MountParser::ReadMountParams()
|
||||
{
|
||||
SkipWhite();
|
||||
mount.ClearParams();
|
||||
|
||||
for( ReadParam(temp) ; !temp.empty() ; ReadParam(temp) )
|
||||
for( ReadParam(temp, param_args) ; !temp.empty() ; ReadParam(temp, param_args) )
|
||||
{
|
||||
if( !mount.ParseStrParam(temp) )
|
||||
if( !mount.ParseStrParam(temp, param_args) )
|
||||
{
|
||||
log << log1 << "MP: unknown mount param: " << temp << logend;
|
||||
err = Error::mount_no_param;
|
||||
|
||||
Reference in New Issue
Block a user