Results 1 to 2 of 2

Thread: Reading Binary Files From Asset folder using "fstream"

  1. #1
    Join Date
    Jul 2013
    Posts
    16
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Reading Binary Files From Asset folder using "fstream"

    I am making a simple application using
    qt-android
    . In that app, i am using C/C++ static library. I compiled this library using Qt-Creator. This static library has one function

    Qt Code:
    1. loadFile(std:string fileName)
    To copy to clipboard, switch view to plain text mode 

    This function load the files using
    fstream
    .

    Qt Code:
    1. fstream data_file(file_name.c_str(), ios::in | ios::binary);
    To copy to clipboard, switch view to plain text mode 

    I read about the asset folder in the android and put my files there. I can check that this files exists by using
    Qt Code:
    To copy to clipboard, switch view to plain text mode 
    . But how can i can load this files using the function available in my static library. From the Qt's MainWindow.cpp, how can tell LoadFile function that where is the file.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,396
    Thanks
    37
    Thanked 1,542 Times in 1,493 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Reading Binary Files From Asset folder using "fstream"

    You are saying that if you pass the filename that worked with QFile to loadFile it doesn't work anymore?

    Cheers,
    _

Similar Threads

  1. defining a secondary "searching folder" for external codes
    By szisziszilvi in forum Qt Programming
    Replies: 2
    Last Post: 12th May 2011, 11:04
  2. Replies: 1
    Last Post: 12th October 2010, 14:43
  3. Replies: 4
    Last Post: 18th April 2010, 00:37
  4. Replies: 8
    Last Post: 5th August 2008, 12:09
  5. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.