~ubuntu-branches/ubuntu/gutsy/amsn/gutsy

« back to all changes in this revision

Viewing changes to utils/TkCximage/src/CxImage/xfile.h

  • Committer: Bazaar Package Importer
  • Author(s): Theodore Karkoulis
  • Date: 2006-01-04 15:26:02 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060104152602-ipe1yg00rl3nlklv
Tags: 0.95-1
New Upstream Release (closes: #345052, #278575).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * File:        xfile.h
 
3
 * Purpose:     General Purpose File Class 
 
4
 */
 
5
/*
 
6
  --------------------------------------------------------------------------------
 
7
 
 
8
        COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
 
9
 
 
10
        CxFile (c)  11/May/2002 Davide Pizzolato - www.xdp.it
 
11
        CxFile version 2.00 23/Aug/2002
 
12
        
 
13
        Special thanks to Chris Shearer Cooper for new features, enhancements and bugfixes
 
14
 
 
15
        Covered code is provided under this license on an "as is" basis, without warranty
 
16
        of any kind, either expressed or implied, including, without limitation, warranties
 
17
        that the covered code is free of defects, merchantable, fit for a particular purpose
 
18
        or non-infringing. The entire risk as to the quality and performance of the covered
 
19
        code is with you. Should any covered code prove defective in any respect, you (not
 
20
        the initial developer or any other contributor) assume the cost of any necessary
 
21
        servicing, repair or correction. This disclaimer of warranty constitutes an essential
 
22
        part of this license. No use of any covered code is authorized hereunder except under
 
23
        this disclaimer.
 
24
 
 
25
        Permission is hereby granted to use, copy, modify, and distribute this
 
26
        source code, or portions hereof, for any purpose, including commercial applications,
 
27
        freely and without fee, subject to the following restrictions: 
 
28
 
 
29
        1. The origin of this software must not be misrepresented; you must not
 
30
        claim that you wrote the original software. If you use this software
 
31
        in a product, an acknowledgment in the product documentation would be
 
32
        appreciated but is not required.
 
33
 
 
34
        2. Altered source versions must be plainly marked as such, and must not be
 
35
        misrepresented as being the original software.
 
36
 
 
37
        3. This notice may not be removed or altered from any source distribution.
 
38
  --------------------------------------------------------------------------------
 
39
 */
 
40
#if !defined(__xfile_h)
 
41
#define __xfile_h
 
42
 
 
43
#ifdef WIN32
 
44
 #include <windows.h>
 
45
#endif
 
46
 
 
47
#include <stdio.h>
 
48
#include <stdlib.h>
 
49
 
 
50
#include "ximadef.h"
 
51
 
 
52
class DLL_EXP CxFile
 
53
{
 
54
public:
 
55
        CxFile(void) { };
 
56
        virtual ~CxFile() { };
 
57
 
 
58
        virtual bool    Close() = 0;
 
59
        virtual size_t  Read(void *buffer, size_t size, size_t count) = 0;
 
60
        virtual size_t  Write(const void *buffer, size_t size, size_t count) = 0;
 
61
        virtual bool    Seek(long offset, int origin) = 0;
 
62
        virtual long    Tell() = 0;
 
63
        virtual long    Size() = 0;
 
64
        virtual bool    Flush() = 0;
 
65
        virtual bool    Eof() = 0;
 
66
        virtual long    Error() = 0;
 
67
        virtual bool    PutC(unsigned char c)
 
68
                {
 
69
                // Default implementation
 
70
                size_t nWrote = Write(&c, 1, 1);
 
71
                return (bool)(nWrote == 1);
 
72
                }
 
73
        virtual long    GetC() = 0;
 
74
};
 
75
 
 
76
#endif //__xfile_h