QSDK 1.1 Documentation
Main Page | Modules | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

Import Struct Reference
[File Import]

#include <Q/import.h>

List of all members.

Static Public Member Functions

Utils::Result read (const char *filename, Net::ReadStream **rs)
Utils::Result read (const char *filename, const char *mimeType, Net::ReadStream **rs)
Utils::Result read (const char *filename, const char *fontName, unsigned int levels, const Q::Database &db, Q::Font *font)


Detailed Description

Import file contents into a Q file.


Member Function Documentation

Utils::Result Import::read const char *  filename,
const char *  fontName,
unsigned int  levels,
const Q::Database db,
Q::Font font
[static]
 

Import the font description file filename, whose type must be either TrueType (ttf) or PostScript (pfa or pfb) into a Q database. This function will create a Q::Font object whose name is fontName in the specified database db. If bd is invalid, the font is created in the first available database. The parameter levels specifies the mip level of the font texture (usually 9, 512x512). If the font pointer is not nil, the value of the create font is returned to it.

See also:
QDS tool ("import" command)
Return values:
IMPORT_NotFound The file could not be located or opened.
IMPORT_NoFreeType The FreeType library could not be found.
IMPORT_MipLevelTooLow The specified mip level for the font textures is too low. The texture cannot contain the font image.

Utils::Result Import::read const char *  filename,
const char *  mimeType,
Net::ReadStream **  rs
[static]
 

Import the file filename, which is not (necessarily) of a known type, the caller specifies the mime-type that they want associated with the Net::ReadStream Content-Type attribute.

This function will return a Net::ReadStream which is suitable for passing to Q::Clip::create().

See also:
QDS tool ("import" command)
Return values:
IMPORT_NotFound The file could not be located or opened.

Utils::Result Import::read const char *  filename,
Net::ReadStream **  rs
[static]
 

Import the file filename. This function will return a Net::ReadStream which is suitable for passing to Q::Clip::create(). This file must have a known type.

On import, the Net::MediaObject for the Net::ReadStream will have the mime-type populated in the Content-Type attribute.

The mime-type is determined by the file extension, it is therefore important that you use the appropriate extension for the file.

Currently supported text formats are:

  • .txt - Generic text file. (mime "text/plain")
  • .qam - Q Animation Machine (mime "text/x-q-qam")
Currently supported image formats are:
  • .png
  • .jpg/.jpeg
  • .tga
  • .bmp
Currently supported audio formats are:
  • .wav
  • .vag
  • .wma
The following formats are supported for legacy reasons, but are deprecated:
  • .qgp - Q Game Placement (mime "text/x-q-qgp")
  • .qgs - Q Game Schema (mime "text/x-q-qgs")
See also:
QDS tool ("import" command)
Return values:
IMPORT_NotFound The file could not be located or opened.
IMPORT_NoHandler The file was not of a recognised extension.

Return to QSDK documentation Contents page. Contact details for support, information and fault-reporting.
Qube Software Limited © 2000-2004