libraries/ltkutils/src/ltkhal.cpp
changeset 54 ea6622dea85a
parent 0 7f656887cf89
equal deleted inserted replaced
52:e07366cad0b2 54:ea6622dea85a
     7 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 // 
     8 // 
     9 // Initial Contributors:
     9 // Initial Contributors:
    10 // Accenture - Initial contribution
    10 // Accenture - Initial contribution
    11 //
    11 //
       
    12 #include <fshell/ltkutils.h>
    12 #include <fshell/ltkhal.h>
    13 #include <fshell/ltkhal.h>
    13 #include <fshell/descriptorutils.h>
    14 #include <fshell/descriptorutils.h>
       
    15 #include <fshell/common.mmh>
    14 #include <HAL.h>
    16 #include <HAL.h>
       
    17 #include <f32file.h>
    15 
    18 
    16 LtkUtils::CHalAttribute::CHalAttribute(TInt aAttribute, TInt aDeviceNumber, TInt aValue, TInt aError, const TDesC& aAttributeName, HBufC* aDescription)
    19 LtkUtils::CHalAttribute::CHalAttribute(TInt aAttribute, TInt aDeviceNumber, TInt aValue, TInt aError, const TDesC& aAttributeName, HBufC* aDescription)
    17 	: iAttribute(aAttribute), iDeviceNumber(aDeviceNumber), iValue(aValue), iError(aError), iAttributeName(aAttributeName), iDescription(aDescription)
    20 	: iAttribute(aAttribute), iDeviceNumber(aDeviceNumber), iValue(aValue), iError(aError), iAttributeName(aAttributeName), iDescription(aDescription)
    18 	{
    21 	{
    19 	}
    22 	}
   339 
   342 
   340 	CHalAttribute* attrib = new(ELeave) CHalAttribute(aAttribute, aDeviceNumber, aValue, KErrNone, attribName, buf.GetHBuf());
   343 	CHalAttribute* attrib = new(ELeave) CHalAttribute(aAttribute, aDeviceNumber, aValue, KErrNone, attribName, buf.GetHBuf());
   341 	CleanupStack::Pop(&buf); // attrib now owns its HBufC*
   344 	CleanupStack::Pop(&buf); // attrib now owns its HBufC*
   342 	return attrib;
   345 	return attrib;
   343 	}
   346 	}
       
   347 
       
   348 EXPORT_C char LtkUtils::GetSystemDrive()
       
   349 	{
       
   350 #ifdef FSHELL_9_1_SUPPORT
       
   351 	TInt ch = EDriveC;
       
   352 	HAL::Get(HAL::ESystemDrive, ch);
       
   353 	return 'a' + ch;
       
   354 #else
       
   355 	TChar systemDrive = 'c';
       
   356 	RFs::DriveToChar(RFs::GetSystemDrive(), systemDrive);
       
   357 	return (char)(TUint)systemDrive;
       
   358 #endif
       
   359 	}