libraries/iosrv/server/config.cpp
changeset 83 706c7a69e448
parent 0 7f656887cf89
equal deleted inserted replaced
82:a6fec624de6c 83:706c7a69e448
    23 _LIT(KConfigDescriptionFile, "\\resource\\iosrv.idf");
    23 _LIT(KConfigDescriptionFile, "\\resource\\iosrv.idf");
    24 
    24 
    25 // Configuration attributes.
    25 // Configuration attributes.
    26 _LIT(KAttConsole, "console");
    26 _LIT(KAttConsole, "console");
    27 _LIT(KAttConsoleSizeAdjustment, "console_size_adjustment");
    27 _LIT(KAttConsoleSizeAdjustment, "console_size_adjustment");
    28 _LIT(KAttConsoleSizeDetect, "console_size_detect");
       
    29 
    28 
    30 
    29 
    31 TIoConfig::TIoConfig()
    30 TIoConfig::TIoConfig()
    32 	: iConsoleImplementation(KDefaultConsole), iConsoleSizeAdjustment(KDefaultSizeAdjustment), iConsoleSizeDetect(ETrue)
    31 	: iConsoleImplementation(KDefaultConsole), iConsoleSizeAdjustment(KDefaultSizeAdjustment)
    33 	{
    32 	{
    34 	}
    33 	}
    35 
    34 
    36 TInt TIoConfig::Init()
    35 TInt TIoConfig::Init()
    37 	{
    36 	{
    44 
    43 
    45 TInt TIoConfig::DoInit(LtkUtils::CIniFile* iniFile)
    44 TInt TIoConfig::DoInit(LtkUtils::CIniFile* iniFile)
    46 	{
    45 	{
    47 	TInt ret = KErrNone;
    46 	TInt ret = KErrNone;
    48 	iConsoleImplementation.Copy(iniFile->GetString(KAttConsole).Left(iConsoleImplementation.MaxLength()));
    47 	iConsoleImplementation.Copy(iniFile->GetString(KAttConsole).Left(iConsoleImplementation.MaxLength()));
    49 	iConsoleSizeDetect = iniFile->GetBool(KAttConsoleSizeDetect);
       
    50 	const TDesC& sizeAdjust(iniFile->GetString(KAttConsoleSizeAdjustment));
    48 	const TDesC& sizeAdjust(iniFile->GetString(KAttConsoleSizeAdjustment));
    51 	if (sizeAdjust.Length())
    49 	if (sizeAdjust.Length())
    52 		{
    50 		{
    53 		TLex lex(sizeAdjust);
    51 		TLex lex(sizeAdjust);
    54 		ret = lex.Val(iConsoleSizeAdjustment.iWidth);
    52 		ret = lex.Val(iConsoleSizeAdjustment.iWidth);
    55 		if (ret) return ret;
    53 		if (ret) return ret;
    56 		lex.Get(); // Skip delimiter.
    54 		lex.Get(); // Skip delimiter.
    57 		ret = lex.Val(iConsoleSizeAdjustment.iHeight);
    55 		ret = lex.Val(iConsoleSizeAdjustment.iHeight);
    58 		if (ret) return ret;
    56 		if (ret) return ret;
    59 		iConsoleSizeDetect = EFalse;
       
    60 		}
    57 		}
    61 	return ret;
    58 	return ret;
    62 	}
    59 	}
    63 
    60 
    64 const TDesC& TIoConfig::ConsoleImplementation() const
    61 const TDesC& TIoConfig::ConsoleImplementation() const
    68 
    65 
    69 const TSize& TIoConfig::ConsoleSizeAdjustment() const
    66 const TSize& TIoConfig::ConsoleSizeAdjustment() const
    70 	{
    67 	{
    71 	return iConsoleSizeAdjustment;
    68 	return iConsoleSizeAdjustment;
    72 	}
    69 	}
    73 
       
    74 TBool TIoConfig::ConsoleSizeDetect() const
       
    75 	{
       
    76 	return iConsoleSizeDetect;
       
    77 	}