home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 31,461 of 33,346   
   =?ISO-8859-1?Q?Daniel_Kr=FCgler?= to All   
   Re: Multiple files in one   
   12 Sep 11 17:32:43   
   
   638a603c   
   XPost: comp.lang.c++   
   From: daniel.kruegler@googlemail.com   
      
   Am 12.09.2011 20:44, schrieb fryme:   
   > I'm trying to create my own file format. I want to store image file   
   > and some text description in that file.   
      
   [..]   
      
   > For that purpose i'm using std::ios::binary. Here is some code,   
   > describes that process (it is sketch, not last variant):   
   > Writing my file.   
   >   
   > long long image_length, desctiption_length;   
   >   
   > std::fstream m_out(output_file_path, std::ios::out |   
   > std::ios::binary);   
   > std::ifstream input_image(m_image_file_path.toUtf8().data());   
      
   [..]   
      
   > Reading my file.   
   >   
   > std::fstream m_in(m_file_path.toUtf8().data(), std::ios::in );   
      
   It seems to me that both input_image and m_in need to be opened as   
   binary streams as well.   
      
   HTH & Greetings from Bremen,   
      
   Daniel Krügler   
      
      
   --   
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca