calendarui/regionalplugins/calenregionalutil/src/calensolarterms.cpp
changeset 50 579cc610882e
parent 23 fd30d51f876b
child 55 2c54b51f39c4
equal deleted inserted replaced
49:5de72ea7a065 50:579cc610882e
    45 
    45 
    46 // ---------------------------------------------------------------------------
    46 // ---------------------------------------------------------------------------
    47 // 
    47 // 
    48 // ---------------------------------------------------------------------------
    48 // ---------------------------------------------------------------------------
    49 //
    49 //
    50 CCalenSolarTerms* CCalenSolarTerms::NewL(RFs& aFs)
    50 EXPORT_C CCalenSolarTerms* CCalenSolarTerms::NewL(RFs& aFs)
    51     {
    51     {
    52     TRACE_ENTRY_POINT;
    52     TRACE_ENTRY_POINT;
    53     
    53     
    54     CCalenSolarTerms* self = new (ELeave) CCalenSolarTerms(aFs);
    54     CCalenSolarTerms* self = new (ELeave) CCalenSolarTerms(aFs);
    55     CleanupStack::PushL( self );
    55     CleanupStack::PushL( self );
    63 
    63 
    64 // ---------------------------------------------------------------------------
    64 // ---------------------------------------------------------------------------
    65 //
    65 //
    66 // ---------------------------------------------------------------------------
    66 // ---------------------------------------------------------------------------
    67 //
    67 //
    68 CCalenSolarTerms::~CCalenSolarTerms()
    68 EXPORT_C CCalenSolarTerms::~CCalenSolarTerms()
    69     {
    69     {
    70     TRACE_ENTRY_POINT;
    70     TRACE_ENTRY_POINT;
    71     TRACE_EXIT_POINT;
    71     TRACE_EXIT_POINT;
    72     }
    72     }
    73 
    73 
    74 
    74 
    75 // ---------------------------------------------------------------------------
    75 // ---------------------------------------------------------------------------
    76 // 
    76 // 
    77 // ---------------------------------------------------------------------------
    77 // ---------------------------------------------------------------------------
    78 //
    78 //
    79 TInt CCalenSolarTerms::CheckSolarTermDateL( const TDateTime& aDate )
    79 EXPORT_C TInt CCalenSolarTerms::CheckSolarTermDateL( const TDateTime& aDate )
    80     {
    80     {
    81     TRACE_ENTRY_POINT;
    81     TRACE_ENTRY_POINT;
    82     
    82     
    83     ReadSolarTermsL( aDate );
    83     ReadSolarTermsL( aDate );
    84     if ( HasSolarTermDataAvailable( aDate ) )
    84     if ( HasSolarTermDataAvailable( aDate ) )
   178     TInt year = aDate.Year();
   178     TInt year = aDate.Year();
   179 
   179 
   180     if (iCachedYear != year)
   180     if (iCachedYear != year)
   181         {
   181         {
   182         RFile file;
   182         RFile file;
   183         RFs& fs = iFs;
   183         TFindFile ffile(iFs);
   184         TFindFile ffile(fs);
       
   185         User::LeaveIfError(ffile.FindByDir(KSolarTermsFile, KSolarTermsPath));
   184         User::LeaveIfError(ffile.FindByDir(KSolarTermsFile, KSolarTermsPath));
   186        // User::LeaveIfError(ffile.FindByPath(KSolarTermsFile, KSolarTermsPath));
   185        // User::LeaveIfError(ffile.FindByPath(KSolarTermsFile, KSolarTermsPath));
   187         
   186         
   188         User::LeaveIfError(file.Open(fs,
   187         User::LeaveIfError(file.Open(iFs,
   189                                      ffile.File(), EFileRead));
   188                                      ffile.File(), EFileRead));
   190         CleanupClosePushL(file);
   189         CleanupClosePushL(file);
   191 
   190 
   192         TInt seekPos = 
   191         TInt seekPos = 
   193             (year - KFirstSolarTermYear) * sizeof(TUint8) * KSolarTermCount;
   192             (year - KFirstSolarTermYear) * sizeof(TUint8) * KSolarTermCount;