- Add new class SplFileInfo

. Make DirectoryIterator inherit it
  . Make SplFileObject inherit it
This commit is contained in:
Marcus Boerger 2005-10-08 15:55:04 +00:00
parent d35d37e74c
commit 7b330f195b
2 changed files with 660 additions and 606 deletions

File diff suppressed because it is too large Load Diff

View File

@ -24,42 +24,52 @@
#include "php.h"
#include "php_spl.h"
extern PHPAPI zend_class_entry *spl_ce_SplFileInfo;
extern PHPAPI zend_class_entry *spl_ce_DirectoryIterator;
extern PHPAPI zend_class_entry *spl_ce_RecursiveDirectoryIterator;
extern PHPAPI zend_class_entry *spl_ce_SplFileObject;
PHP_MINIT_FUNCTION(spl_directory);
typedef struct _spl_ce_dir_object {
zend_object std;
php_stream *dirp;
php_stream_dirent entry;
char *path;
char *path_name;
int path_name_len;
char *sub_path;
int sub_path_len;
int index;
} spl_ce_dir_object;
typedef enum {
SPL_FS_INFO,
SPL_FS_DIR,
SPL_FS_FILE,
} SPL_FS_OBJ_TYPE;
typedef struct _spl_file_object {
typedef struct _spl_filesystem_object {
zend_object std;
php_stream *stream;
php_stream_context *context;
zval *zcontext;
char *path;
int path_len;
char *file_name;
int file_name_len;
char *open_mode;
int open_mode_len;
zval *current_zval;
char *current_line;
size_t current_line_len;
size_t max_line_len;
long current_line_num;
long flags;
zval zresource;
zend_function *func_getCurr;
} spl_file_object;
int file_name_len;
SPL_FS_OBJ_TYPE type;
union {
struct {
php_stream *dirp;
php_stream_dirent entry;
char *sub_path;
int sub_path_len;
int index;
int is_recursive;
} dir;
struct {
php_stream *stream;
php_stream_context *context;
zval *zcontext;
char *open_mode;
int open_mode_len;
zval *current_zval;
char *current_line;
size_t current_line_len;
size_t max_line_len;
long current_line_num;
long flags;
zval zresource;
zend_function *func_getCurr;
} file;
} u;
} spl_filesystem_object;
#define SPL_FILE_OBJECT_DROP_NEW_LINE 0x00000001 /* drop new lines */