本文整理汇总了C++中CApaCommandLine::DocumentName方法的典型用法代码示例。如果您正苦于以下问题:C++ CApaCommandLine::DocumentName方法的具体用法?C++ CApaCommandLine::DocumentName怎么用?C++ CApaCommandLine::DocumentName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CApaCommandLine
的用法示例。
在下文中一共展示了CApaCommandLine::DocumentName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EnvironmentSlotsReaderL
/**
Application invoked as part of CommandLine tests
@SYMPREQ 280 File Handle Support
FunctionDesc Tests Environment slots .
Acquires a Mutex for log file access
Invokes EnvironmentSlotsReaderL() which returns an CApaCommandLine Object
Verifies the values returned by the GET APIs of CApaCommandLine object with those of predefined values
Writes "Pass" to the logfile if verification passes else "Fail" is written.
*/
void testEnvironmentSlotsL()
{
TPtrC appName;
TPtrC docName;
TApaCommand command = EApaCommandOpen;
TBool testResult = PASS;
//Get the Mutex to access the log file
RMutex fileAccess;
fileAccess.OpenGlobal(KTLogFileAccess);
fileAccess.Wait();
/** Invoke EnvironmenstSlotsReaderL() function which would constuct the CApaCommandLine class object
from the environment slots and return the pointer to that object */
//CApaCommandLine* cmdLine = CApaCommandLine::EnvironmentSlotsReaderL();
//Method CApaCommandLine::EnvironmentSlotsReaderL has been implemented in a different fashion
CApaCommandLine* cmdLine;
CApaCommandLine::GetCommandLineFromProcessEnvironment(cmdLine);
CleanupStack::PushL(cmdLine);
appName.Set(KTAppName);
docName.Set(KTDocName);
RFs fSession;
fSession.Connect();
RFile logFile;
TBufC<KMaxFilePath> testFilePath(KFilePath);
//Open the Log file in Write Mode
User::LeaveIfError(logFile.Replace(fSession,testFilePath,EFileWrite));
// Compare the values returned by GET APIs with pre defined values
TESTCOND(appName,cmdLine->ExecutableName());
if(appName != cmdLine->ExecutableName())
{
logFile.Write(KTFail);
logFile.Write(KTApp);
}
TESTCOND(docName,cmdLine->DocumentName());
if(docName != cmdLine->DocumentName())
{
logFile.Write(KTFail);
logFile.Write(KTDoc);
}
TESTCOND(command,cmdLine->Command());
if(command != cmdLine->Command())
{
logFile.Write(KTFail);
logFile.Write(KTCommand);
}
if(testResult == PASS)
{
logFile.Write(KTPass);
}
//Close the file and the file session
logFile.Close();
fSession.Close();
//Signal the Mutex
fileAccess.Signal();
CleanupStack::PopAndDestroy(cmdLine);
}