// The following routine returns the account id for a given file name
// returns 0 for files that do not contain a recognisable account id.
// The account id is assumed to be the first integer found between 2 '_' characters. eg for file 'account_123_4_pdr.bin' the value would be 123
static uint32 getAccountIdFromFileName(NLMISC::CSString filename)
{
	uint32 accountId;
	do
	{
		DROP_IF(filename.empty(),"No account number found in file: "+filename,return 0);
		accountId= filename.strtok("_.").atoui();
	}
	while (accountId==0);
	return accountId;
}
Пример #2
0
	NLMISC::CSString extractNamedParameter(const NLMISC::CSString& argName,NLMISC::CSString rawArgs)
	{
		while (!rawArgs.empty())
		{
			NLMISC::CSString keyword;
			NLMISC::CSString args;
			keyword= rawArgs.firstWord(true);
			rawArgs=rawArgs.strip();
			if (rawArgs[0]=='(')
			{
				args=rawArgs.matchDelimiters(true).stripBlockDelimiters();
			}

			if (keyword==argName)
			{
				return args;
			}
		}

		return NLMISC::CSString();
	}