Show
Ignore:
Timestamp:
05/01/08 01:43:10 (7 months ago)
Author:
flynd
Message:

Create history dir if missing before writing history file in it. Combined the Save and Append functions as they were almost identical.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/licq/include/licq_history.h

    r4526 r6177  
    1616  void SetFile(const char *, unsigned long); 
    1717  void SetFile(const char *, const char *, unsigned long); 
    18   void Append(const char *); 
     18  void Append(const char* buf) { Write(buf, true); } 
    1919  bool Load(HistoryList &); 
    2020  static void Clear(HistoryList &); 
    21   void Save(const char *); 
     21  void Save(const char* buf) { Write(buf, false); } 
    2222  const char *Description()  { return m_szDescription; } 
    2323  const char *FileName()     { return m_szFileName; } 
     24 
     25  /** 
     26   * Write to the history file, creating it if necessary 
     27   * 
     28   * @param buf String with data to write 
     29   * @param append True to append data or false to overwrite file 
     30   */ 
     31  void Write(const char* buf, bool append); 
     32 
    2433protected: 
    2534  char *m_szFileName;