Gphoto2::File Class Reference

The base class which represents a File on the camera. More...

Inheritance diagram for Gphoto2::File:

Inheritance graph
[legend]
Collaboration diagram for Gphoto2::File:

Collaboration graph
[legend]

Public Member Functions

long Download (Stream stream)
 Reads the entire file and writes it to the supplied stream.
Stream Download ()
 Returns a stream which can be used to access the file.
void Update ()
 Synchronises the file metadata with the camera.

Protected Member Functions

 File (Camera camera, FileSystem fs, string metadata, string path, string filename, bool local)
 Creates a new File.
 File (string path, string filename)
int GetInt (string key)
 Searches the metadata for the specified key and returns the value as an integer.
string GetString (string key)
 Searches the metadata for the specified key and returns the value as a string.
void ParseMetadata (string metadata)
 Parses a metadata string (as returned by libgphoto2) into key/value pairs.
void SetValue (string key, int value)
 Changes the value of the metadata to the specified value and sets the 'IsDirty' property to true if the value has changed.
void SetValue (string key, string value)
 Changes the value of the metadata to the specified value and sets the 'IsDirty' property to true if the value has changed.

Properties

DateTime DateAdded [get]
DateTime DateCreated [get]
DateTime DateModified [get]
string Filename [get]
bool IsDirty [get, set]
DateTime LastPlayed [get]
bool LocalFile [get]
Dictionary< string, string > Metadata [get]
string Path [get]
int Rating [get, set]
long Size [get, set]

Detailed Description

The base class which represents a File on the camera.


Constructor & Destructor Documentation

Gphoto2::File::File ( Camera  camera,
FileSystem  fs,
string  metadata,
string  path,
string  filename,
bool  local 
) [inline, protected]

Creates a new File.

Parameters:
camera The camera this file is on (null if the file is a local file) A Camera
fs The filesystem this file is on (null if the file is a local file) A FileSystem
metadata The metadata for this file (string.Empty if there is none) A System.String
path The path to this file A System.String
filename The filename A System.String
local True if the file is on the local filesystem, false if the file is on the camera A System.Boolean


Member Function Documentation

Stream Gphoto2::File::Download (  )  [inline]

Returns a stream which can be used to access the file.

Parameters:
stream A Stream

long Gphoto2::File::Download ( Stream  stream  )  [inline]

Reads the entire file and writes it to the supplied stream.

Parameters:
stream A Stream
Returns:
The number of bytes written A System.Int32

int Gphoto2::File::GetInt ( string  key  )  [inline, protected]

Searches the metadata for the specified key and returns the value as an integer.

Parameters:
key The key to get the value for A System.String
Returns:
The value corresponding to the key if successful. -1 is returned if the key couldn't be parsed as an int or didn't exist. A System.Int32

string Gphoto2::File::GetString ( string  key  )  [inline, protected]

Searches the metadata for the specified key and returns the value as a string.

Parameters:
key The key to get the value for A System.String
Returns:
A non-null string A System.String

void Gphoto2::File::ParseMetadata ( string  metadata  )  [inline, protected]

Parses a metadata string (as returned by libgphoto2) into key/value pairs.

Parameters:
metadata The metadata string returned by libgphoto2 A System.String

void Gphoto2::File::SetValue ( string  key,
string  value 
) [inline, protected]

Changes the value of the metadata to the specified value and sets the 'IsDirty' property to true if the value has changed.

Parameters:
key The key to change the value of A System.String
value The new value. If the value is null, it is treated as string.Empty A System.String

void Gphoto2::File::SetValue ( string  key,
int  value 
) [inline, protected]

Changes the value of the metadata to the specified value and sets the 'IsDirty' property to true if the value has changed.

Parameters:
key The key to change the value of A System.String
value The new value A System.Int32

void Gphoto2::File::Update (  )  [inline]

Synchronises the file metadata with the camera.


Property Documentation

DateTime Gphoto2::File::DateAdded [get]

The date when the file was added to the device

DateTime Gphoto2::File::DateCreated [get]

The date when the file was created

DateTime Gphoto2::File::DateModified [get]

The date the file was last modified on

string Gphoto2::File::Filename [get]

The name of the file

bool Gphoto2::File::IsDirty [get, set]

True if the metadata has been changed and needs to be syncronised with the device

DateTime Gphoto2::File::LastPlayed [get]

The date when the file was last played

bool Gphoto2::File::LocalFile [get]

True if the file is on the local filesystem, false if the file is on the MTP device

Dictionary<string, string> Gphoto2::File::Metadata [get]

A list of key/value pairs representing the metadata stored for the file

string Gphoto2::File::Path [get]

The path to the file

int Gphoto2::File::Rating [get, set]

The rating of the file

long Gphoto2::File::Size [get, set]

The size of the file in bytes


The documentation for this class was generated from the following file:

Generated on Fri Oct 16 13:14:06 2009 for libgphoto2 Mono/.NET bindings (libgphoto2-sharp) API by  doxygen 1.5.9