?? transdebugprint.cpp
字號:
// Copyright (c) 2004 - 2007, Symbian Software Ltd. All rights reserved.
#include <f32file.h>
#include "transport.h"
EXPORT_C void TransDebugPrint(const TText16* aFmt, ...)
/**
Write the supplied debug information to the log file.
This function is empty if TRANSPORT_LOGGING is not defined.
@param fmt Standard Symbian OS format string for following arguments.
*/
{
#ifndef TRANSPORT_LOGGING
(void) aFmt;
#else
VA_LIST argptr;
VA_START(argptr, aFmt);
TBuf<512> buf;
const TPtrC fmtPtr(aFmt);
buf.FormatList(fmtPtr, argptr);
buf.Append('\r');
buf.Append('\n');
RFs fs;
RFile f;
TInt r = fs.Connect();
// use a clean file every time the application is run
#if defined(__WINS__)
_LIT(KLogFileName, "c:\\oandx.txt");
#elif defined(__SERIES60_3X__)
_LIT(KLogFileName, "e:\\oandx.txt");
#else
_LIT(KLogFileName, "d:\\oandx.txt");
#endif
TAny* delPtr = Dll::Tls();
if (delPtr == 0)
{
r = fs.Delete(KLogFileName);
if (r == KErrNotFound)
r = KErrNone;
if (r == KErrNone)
r = Dll::SetTls((TAny*)1);
if (r != KErrNone)
User::Panic(_L("lognodelete"), r);
}
if (r == KErrNone)
{
TUint openMode = EFileShareExclusive | EFileStreamText | EFileWrite;
r = f.Open(fs, KLogFileName, openMode);
if (r == KErrNotFound)
r = f.Create(fs, KLogFileName, openMode);
}
if (r == KErrNone)
{
TInt endDelta = 0;
r = f.Seek(ESeekEnd, endDelta);
}
if (r == KErrNone)
{
TBuf8<512> buf8;
buf8.Copy(buf);
r = f.Write(buf8);
}
if (r == KErrNone)
f.Flush();
f.Close();
fs.Close();
VA_END(argptr);
#endif // #else #ifndef TRANSPORT_LOGGING
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -