Main Page | Class List | File List | Class Members | File Members

ipod_file_utils.h File Reference

File handling routines. More...

#include <stdint.h>

Go to the source code of this file.

Typedefs

typedef void(* ipod_file_transfer_func )(uint64_t transferred, uint64_t total, void *userData)
 Callback used during file transfers.

Functions

int ipod_directory_exists (const char *path)
 Test for the existence of a directory.
int ipod_file_exists (const char *path)
 Test for the existence of a file.
void ipod_delete_file (const char *path)
 Delete a file.
int ipod_copy_file (const char *srcFile, const char *dstFile, ipod_file_transfer_func callback, void *userData)
 Copy a file from one location to another.
const char * ipod_extension_of (const char *path, const char *def)
 Returns a pointer to the extension of the file, including the dot.
const char * ipod_file_name_of (const char *path)
 Locate the filename in a full file path.


Detailed Description

File handling routines.


Typedef Documentation

typedef void(* ipod_file_transfer_func)(uint64_t transferred, uint64_t total, void *userData)
 

Callback used during file transfers.

Parameters:
transferred the number of bytes transferred so far
total the total numb er of bytes to be transferred
userData application-specific data


Function Documentation

int ipod_copy_file const char *  srcFile,
const char *  dstFile,
ipod_file_transfer_func  callback,
void *  userData
 

Copy a file from one location to another.

Parameters:
srcFile the file to be copied
dstFile the location to which to copy the file
callback the function to call during the copy to report progess information
userData application-specific data to provide to the callback function
Returns:
0 if the copy succeeded, -1 if it failed

void ipod_delete_file const char *  path  ) 
 

Delete a file.

Parameters:
path a path to a file to be deleted

int ipod_directory_exists const char *  path  ) 
 

Test for the existence of a directory.

Parameters:
path a path to a directory
Returns:
1 if the directory exists, 0 otherwise

const char* ipod_extension_of const char *  path,
const char *  def
 

Returns a pointer to the extension of the file, including the dot.

Parameters:
path a file path
def a string to return if no extension can be found
Returns:
a pointer to the extension
 printf(ipod_extension_of("/home/jayne/hero_of_canton.mp3",".wav"));  -> ".mp3"

int ipod_file_exists const char *  path  ) 
 

Test for the existence of a file.

Parameters:
path a path to a file
Returns:
1 if the file exists, 0 otherwise

const char* ipod_file_name_of const char *  path  ) 
 

Locate the filename in a full file path.

Parameters:
path a full file path
Returns:
a pointer to the filename portion of the path
 printf(ipod_file_name_of("/home/jayne/hero_of_canton.mp3")); -> "hero_of_canton.mp3"


Generated on Tue Dec 13 14:55:22 2005 for libipod by  doxygen 1.3.9.1