zeroconf/zeroconfsharing/cfileparser.cpp
author guru.kini@nokia.com
Wed, 21 Jul 2010 14:28:48 +0530
changeset 21 ff5174af067c
permissions -rw-r--r--
ZeroConf Sharing Application
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
21
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
     1
/*
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
     2
* Copyright (c) 2001-2008 Nokia Corporation and/or its subsidiary(-ies).
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
     3
* All rights reserved.
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
     4
* This component and the accompanying materials are made available
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
     6
* which accompanies this distribution, and is available
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
     8
*
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
     9
* Initial Contributors:
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    11
*
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    12
* Contributors:
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    13
*
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    14
* Description: 
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    15
*
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    16
*/
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    17
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    18
#include "cfileparser.h"
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    19
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    20
#include <S32FILE.H>
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    21
#include <VERSIT.H> 
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    22
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    23
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    24
CFileParser::CFileParser()
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    25
    {
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    26
   
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    27
    }
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    28
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    29
CFileParser::~CFileParser()
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    30
    {
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    31
    iFileServ.Close();    
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    32
    
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    33
    }
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    34
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    35
CFileParser* CFileParser::NewLC()
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    36
    {
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    37
    CFileParser* self = new (ELeave) CFileParser();
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    38
    CleanupStack::PushL(self);
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    39
    self->ConstructL();
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    40
    return self;
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    41
    }
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    42
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    43
CFileParser* CFileParser::NewL()
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    44
    {
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    45
    CFileParser* self = CFileParser::NewLC();
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    46
    CleanupStack::Pop(); // self;
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    47
    return self;
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    48
    }
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    49
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    50
void CFileParser::ConstructL()
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    51
    {
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    52
    iFileServ.Connect();
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    53
    iStart = false;
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    54
    SetMediaType(CFileParser::ENone);   //no  specific folder
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    55
    
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    56
    }
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    57
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    58
void CFileParser::SetMediaType(TMediaType aType)
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    59
    {
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    60
    iCurMediaType = aType;
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    61
    }
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    62
    
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    63
CFileParser::TMediaType CFileParser::GetMediaType()
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    64
    {
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    65
    return iCurMediaType;
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    66
    }
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    67
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    68
/*
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    69
 * aFileName - is the file to be parsed
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    70
 * this contain the text in the form
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    71
 * [photos]
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    72
 * --
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    73
 * --
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    74
 * [/photos]
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    75
 * [music]
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    76
 * --
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    77
 * --[/music]
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    78
 * [videos]
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    79
 * ---
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    80
 * --
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    81
 * [/videos]
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    82
 * ParseFile function takes such a file & parses the sections
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    83
 * and writes the photo filename to aPhotoFile,
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    84
 * music file names to aMusicFile &
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    85
 * video file names to aVideoFile
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    86
 * 
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    87
 */
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    88
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    89
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    90
void CFileParser::ParseFile( const TDesC& aFileName,const TDesC& aPhotoFile,const TDesC& aMusicFile,const TDesC& aVideoFile )
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    91
    {
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    92
    TFileText lineReader;
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    93
    TFileName name;
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    94
    RBuf8 fileName;
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    95
    RFile photoFile, musicFile, videoFile;
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    96
    
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    97
    //declare the start & end tags
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    98
    _LIT(KPhotoStart,"[photos]");
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
    99
    _LIT(KMusicStart,"[music]");
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   100
    _LIT(KVideoStart,"[videos]");
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   101
    _LIT(KPhotoEnd,"[/photos]");
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   102
    _LIT(KMusicEnd,"[/music]");
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   103
    _LIT(KVideoEnd,"[/videos]");
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   104
    
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   105
    _LIT(KStartTag,"[%s]");
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   106
    _LIT(KEndTag,"[/%s]");
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   107
    
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   108
    TBuf<KMaxFileName> buf;
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   109
    name.Copy(aFileName);
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   110
    RFileReadStream readStream;
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   111
    readStream.PushL();
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   112
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   113
    User::LeaveIfError(readStream.Open(iFileServ, name, EFileRead));
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   114
    CLineReader* myReader = CLineReader::NewL(readStream);
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   115
    TInt aPos = 0;
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   116
    TInt aErr = 0;
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   117
    
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   118
    photoFile.Replace(iFileServ,aPhotoFile,EFileWrite);
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   119
    musicFile.Replace(iFileServ,aMusicFile,EFileWrite);
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   120
    videoFile.Replace(iFileServ,aVideoFile,EFileWrite);
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   121
    
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   122
    while(aErr!=KErrEof)
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   123
       {
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   124
          myReader->ReadLineL(aPos, aErr);
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   125
        // Do your parsing here ..          
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   126
          fileName.CreateL(KMaxFileName);
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   127
          buf.Copy(myReader->iBufPtr);          
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   128
          //compare buf with the start & end tags
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   129
          //if it is the start or end tag, dont write to the file          
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   130
          if( buf.Compare(KPhotoStart)== 0){  //photo tag start
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   131
              SetMediaType(CFileParser::EPhotos); 
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   132
              iStart = true;
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   133
          }
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   134
          else if( buf.Compare(KPhotoEnd)== 0){        //photo tag end
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   135
              SetMediaType(CFileParser::ENone);  
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   136
          }
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   137
          else if( buf.Compare(KMusicStart)== 0 ){       //music tag start
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   138
              SetMediaType(CFileParser::EMusic);
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   139
              iStart = true;
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   140
          }
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   141
          else if( buf.Compare(KMusicEnd)== 0){
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   142
              SetMediaType(CFileParser::ENone);       //music tag end
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   143
          }
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   144
          else if( buf.Compare(KVideoStart)== 0 ){
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   145
              SetMediaType(CFileParser::EVideos);  
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   146
              iStart = true;//video tag start
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   147
          }
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   148
          else if( buf.Compare(KVideoEnd)== 0 ){       
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   149
              SetMediaType(CFileParser::ENone);       //video tag end
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   150
          }
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   151
          else 
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   152
              {
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   153
                  fileName.Copy(buf);
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   154
                  switch( GetMediaType() )
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   155
                    {
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   156
                      case EPhotos:
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   157
                          {
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   158
                          if(!iStart){
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   159
                              photoFile.Write(_L8("\n"));
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   160
                          }
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   161
                          else {
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   162
                              iStart = false;
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   163
                          }
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   164
                          photoFile.Write(fileName);
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   165
                          }            
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   166
                              break;
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   167
                      case EMusic:
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   168
                          {
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   169
                          if(!iStart){
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   170
                              musicFile.Write(_L8("\n"));
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   171
                          }
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   172
                          else {
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   173
                              iStart = false;
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   174
                          }
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   175
                          musicFile.Write(fileName);
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   176
                          }
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   177
                              break;
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   178
                      case EVideos:
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   179
                          {
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   180
                          if(!iStart){
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   181
                              videoFile.Write(_L8("\n"));
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   182
                          }
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   183
                          else {
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   184
                               iStart = false;
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   185
                           }
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   186
                          videoFile.Write(fileName);
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   187
                          }
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   188
                              break;
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   189
                      default:
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   190
                              break;
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   191
                    }
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   192
              }
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   193
          
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   194
       }
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   195
    //close all file handles
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   196
    photoFile.Close();
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   197
    musicFile.Close();
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   198
    videoFile.Close();
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   199
    //close the filename rbuf
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   200
    fileName.Close();
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   201
    CleanupStack::PopAndDestroy();    
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   202
    delete myReader;
ff5174af067c ZeroConf Sharing Application
guru.kini@nokia.com
parents:
diff changeset
   203
    }