bump product version to 4.1.6.2
[LibreOffice.git] / include / cosv / file.hxx
blob86c880e731845ce3d0e244156b178f6605a3e673
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef CSV_FILE_HXX
21 #define CSV_FILE_HXX
23 // USED SERVICES
24 // BASE CLASSES
25 #include <cosv/bstream.hxx>
26 #include <cosv/openclose.hxx>
27 // COMPONENTS
28 #include <stdio.h>
29 #include <cosv/string.hxx>
30 // PARAMETERS
31 #include <cosv/persist.hxx>
32 #include <cosv/ploc.hxx>
35 namespace csv
39 /** @task
40 File is a class representing a file.
42 class File : public bstream,
43 public OpenClose,
44 public ploc::Persistent
46 public:
47 // LIFECYCLE
48 File(
49 const char * i_sLocation,
50 uintt in_nMode = CFM_RW );
51 File(
52 const String & i_sLocation,
53 uintt in_nMode = CFM_RW );
54 virtual ~File();
56 // INQUIRY
57 uintt Mode() const;
59 private:
60 enum E_LastIO
62 io_none = 0,
63 io_read,
64 io_write
67 // Interface bistream:
68 virtual uintt do_read(
69 void * out_pDest,
70 uintt i_nNrofBytes);
71 virtual bool inq_eod() const;
72 // Interface bostream:
73 virtual uintt do_write(
74 const void * i_pSrc,
75 uintt i_nNrofBytes);
76 // Interface bstream:
77 virtual uintt do_seek(
78 intt i_nDistance,
79 seek_dir i_eStartPoint = ::csv::beg );
80 virtual uintt inq_position() const;
81 // Interface OpenClose:
82 virtual bool do_open(
83 uintt in_nOpenModeInfo );
84 virtual void do_close();
85 virtual bool inq_is_open() const;
86 // Interface Persistent:
87 virtual const ploc::Path &
88 inq_MyPath() const;
89 // DATA
90 ploc::Path aPath;
91 FILE * pStream;
93 uintt nMode; /// RWMode, OpenMode and ShareMode.
94 E_LastIO eLastIO;
99 // IMPLEMENTATION
101 inline uintt
102 File::Mode() const
103 { return nMode; }
106 } // namespace csv
111 #endif
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */