libraries/iosrv/client/command_info_file.cpp
changeset 66 2a78c4ff2eab
parent 0 7f656887cf89
child 87 63fd51b1ff80
equal deleted inserted replaced
63:6a2083f7eeb8 66:2a78c4ff2eab
    25 _LIT(KCmndName, "name");
    25 _LIT(KCmndName, "name");
    26 _LIT(KCmndShortDescription, "short-description");
    26 _LIT(KCmndShortDescription, "short-description");
    27 _LIT(KCmndLongDescription, "long-description");
    27 _LIT(KCmndLongDescription, "long-description");
    28 _LIT(KCmndSeeAlso, "see-also");
    28 _LIT(KCmndSeeAlso, "see-also");
    29 _LIT(KCmndCopyright, "copyright");
    29 _LIT(KCmndCopyright, "copyright");
       
    30 _LIT(KCmndSmokeTest, "smoke-test");
    30 _LIT(KCmndArgument, "argument");
    31 _LIT(KCmndArgument, "argument");
    31 _LIT(KCmndOption, "option");
    32 _LIT(KCmndOption, "option");
    32 _LIT(KCmndInclude, "include");
    33 _LIT(KCmndInclude, "include");
    33 _LIT(KCmndSubCommand, "sub-command");
    34 _LIT(KCmndSubCommand, "sub-command");
    34 _LIT(KCmndEnumValue, "enum-value");
    35 _LIT(KCmndEnumValue, "enum-value");
   313 			}
   314 			}
   314 		else if (command == KCmndCopyright)
   315 		else if (command == KCmndCopyright)
   315 			{
   316 			{
   316 			iCopyright.Set(TextToNextCommand(aLex));
   317 			iCopyright.Set(TextToNextCommand(aLex));
   317 			}
   318 			}
       
   319 		else if (command == KCmndSmokeTest)
       
   320 			{
       
   321 			// Hmm no easy way to get the line number we're currently on
       
   322 			iSmokeTestLineNumber = 1;
       
   323 			TLex lex(aLex);
       
   324 			lex.Inc(-aLex.Offset()); // Only way to put a TLex back to the beginning!
       
   325 			TPtrC preceding = lex.Remainder().Left(aLex.Offset());
       
   326 			const TUint16* ptr = preceding.Ptr();
       
   327 			const TUint16* end = ptr + preceding.Length();
       
   328 			while (ptr != end)
       
   329 				{
       
   330 				if (*ptr++ == '\n') iSmokeTestLineNumber++;
       
   331 				}
       
   332 			// At this point iSmokeTestLineNumber points to the "==smoketest" line - add 2 to skip this line and the blank line below it
       
   333 			iSmokeTestLineNumber += 2;
       
   334 			iSmokeTest.Set(TextToNextCommand(aLex));
       
   335 			}
   318 		else if (command == KCmndArgument)
   336 		else if (command == KCmndArgument)
   319 			{
   337 			{
   320 			ReadArgumentL(aLex, aFileName);
   338 			ReadArgumentL(aLex, aFileName);
   321 			}
   339 			}
   322 		else if (command == KCmndOption)
   340 		else if (command == KCmndOption)
   811 EXPORT_C const TDesC& CCommandInfoFile::Copyright() const
   829 EXPORT_C const TDesC& CCommandInfoFile::Copyright() const
   812 	{
   830 	{
   813 	return iCopyright;
   831 	return iCopyright;
   814 	}
   832 	}
   815 
   833 
       
   834 EXPORT_C const TDesC& CCommandInfoFile::SmokeTest() const
       
   835 	{
       
   836 	return iSmokeTest;
       
   837 	}
       
   838 
       
   839 EXPORT_C TInt CCommandInfoFile::GetSmokeTestStartingLineNumber() const
       
   840 	{
       
   841 	return iSmokeTestLineNumber;
       
   842 	}
       
   843 
   816 EXPORT_C const RCommandArgumentList& CCommandInfoFile::Arguments()
   844 EXPORT_C const RCommandArgumentList& CCommandInfoFile::Arguments()
   817 	{
   845 	{
   818 	return iArguments;
   846 	return iArguments;
   819 	}
   847 	}
   820 
   848 
   889 
   917 
   890 CCommandInfoFile::CCommandInfoFile(CCommandInfoFile& aParent)
   918 CCommandInfoFile::CCommandInfoFile(CCommandInfoFile& aParent)
   891 	: iFileName(aParent.iFileName), iParent(&aParent)
   919 	: iFileName(aParent.iFileName), iParent(&aParent)
   892 	{
   920 	{
   893 	}
   921 	}
       
   922 
       
   923 EXPORT_C const TDesC& CCommandInfoFile::CifFileName() const
       
   924 	{
       
   925 	return iFileName;
       
   926 	}