~ubuntu-branches/ubuntu/hardy/avidemux/hardy

« back to all changes in this revision

Viewing changes to avidemux/ADM_script/StdFile.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2006-12-15 17:13:20 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20061215171320-w79pvpehxx2fr217
Tags: 1:2.3.0-0.0ubuntu1
* Merge from debian-multimedia.org, remaining Ubuntu change:
  - desktop file,
  - no support for ccache and make -j.
* Closes Ubuntu: #69614.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// StdFile.h: interface for the CStdFile class.
 
2
//
 
3
//////////////////////////////////////////////////////////////////////
 
4
/*
 
5
Copyright 2001-2005 Anish Mistry. All rights reserved.
 
6
 
 
7
Note:  This file is available under a BSD license.  Contact the author
 
8
at amistry@am-productions.biz
 
9
*/
 
10
 
 
11
#if !defined(AFX_STDFILE_H__44214218_8F1A_4792_8D4D_8147F50E168D__INCLUDED_)
 
12
#define AFX_STDFILE_H__44214218_8F1A_4792_8D4D_8147F50E168D__INCLUDED_
 
13
 
 
14
#if _MSC_VER > 1000
 
15
#pragma once
 
16
#endif // _MSC_VER > 1000
 
17
 
 
18
#include <iostream>
 
19
#include <iomanip>
 
20
#include <fstream>
 
21
#include <stdlib.h>
 
22
#include <string>
 
23
 
 
24
using namespace std;
 
25
 
 
26
#ifdef WIN32
 
27
        const char DIRECTORY_DELIMITOR = '\\';
 
28
#else
 
29
        const char DIRECTORY_DELIMITOR = '/';
 
30
        #define _MAX_PATH 1024
 
31
#endif
 
32
 
 
33
class CStdFile
 
34
{
 
35
public:
 
36
        char Peek();
 
37
        int WriteString(const char *pBuffer);
 
38
        char * ReadString(char *pBuffer, int nMaxLen,char cDelim = ' ');
 
39
        unsigned long int GetPos();
 
40
        unsigned long int Seek(unsigned long int pos,ios::seekdir start);
 
41
        unsigned long int GetLength();
 
42
        unsigned long int Write(const char *buffer, unsigned long int bytesToWrite);
 
43
        unsigned long int Read(char *buffer, unsigned long int bytesToRead);
 
44
        const char * GetFilePath();
 
45
        const char * GetFileName();
 
46
        CStdFile(void);
 
47
        virtual ~CStdFile(void);
 
48
//      static bool Copy(const char *source,const char *dest, bool bOverwrite);
 
49
        static int Rename(const char *source,const char *dest);
 
50
        static int Delete(const char *fileName);
 
51
        virtual bool Open(const char *filename, ios::openmode accessFlags);
 
52
        unsigned long int WriteLine(const char *);
 
53
        unsigned long int ReadLine(char *bufferOut);
 
54
        virtual bool Close();
 
55
 
 
56
protected:
 
57
        void GetName(const char *fileString,char *fileBufferOut);
 
58
        char *m_pPath;
 
59
        char *m_pName;
 
60
        fstream m_fsFile;
 
61
};
 
62
 
 
63
#endif // !defined(AFX_STDFILE_H__44214218_8F1A_4792_8D4D_8147F50E168D__INCLUDED_)