--- parser3/src/include/pa_common.h 2001/07/07 17:59:02 1.45 +++ parser3/src/include/pa_common.h 2001/10/24 16:33:02 1.55 @@ -2,10 +2,9 @@ Parser: commonly used functions. Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) - Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_common.h,v 1.45 2001/07/07 17:59:02 parser Exp $ + $Id: pa_common.h,v 1.55 2001/10/24 16:33:02 parser Exp $ */ #ifndef PA_COMMON_H @@ -69,6 +68,11 @@ int __snprintf(char *, size_t, const cha #endif +/** under WIN32 "t" mode fixes DOS chars OK, + can't say that about other systems/ line break styles +*/ +void fix_line_breaks(char *src, size_t& size); + /** read specified text file using pool, if fail_on_read_problem is true[default] throws an exception @@ -102,12 +106,23 @@ void file_write(Pool& pool, throws an exception in case of problems */ void file_delete(Pool& pool, const String& file_spec); +/** + move specified file + throws an exception in case of problems +*/ +void file_move(Pool& pool, const String& old_spec, const String& new_spec); bool file_readable(const String& file_spec); bool dir_readable(const String& file_spec); +String *file_readable(const String& path, const String& name); bool file_executable(const String& file_spec); -size_t file_size(const String& file_spec); +bool file_stat(const String& file_spec, + size_t& rsize, + time_t& ratime, + time_t& rmtime, + time_t& rctime, + bool fail_on_read_problem=true); /** scans for @a delim[default \n] in @a *row_ref, @@ -128,7 +143,7 @@ inline int min(int a,int b){ return a @@ -149,9 +164,10 @@ void back_slashes_to_slashes(char *s); #endif bool StrEqNc(const char *s1, const char *s2, bool strict=true); -char *unquote(char*& current, char stop_at); #define SECS_PER_DAY (60*60*24) int getMonthDays(int year, int month); +void remove_crlf(char *start, char *end); + #endif