Debian Codegraph @

src/tools/file/xattr.h

raw
1 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
2
3 /* libmwaw: tools
4 * Version: MPL 2.0 / LGPLv2+
5 *
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 2.0 (the "License"); you may not use this file except in compliance with
8 * the License or as specified alternatively below. You may obtain a copy of
9 * the License at http://www.mozilla.org/MPL/
10 *
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
14 * License.
15 *
16 * Major Contributor(s):
17 * Copyright (C) 2011, 2012 Alonso Laurent ([email protected])
18 *
19 *
20 * All Rights Reserved.
21 *
22 * For minor contributions see the git repository.
23 *
24 * Alternatively, the contents of this file may be used under the terms of
25 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
26 * in which case the provisions of the LGPLv2+ are applicable
27 * instead of those above.
28 */
29
30 #ifndef MWAW_XATTR_H
31 # define MWAW_XATTR_H
32
33 #include <string>
34
35 namespace libmwaw_tools
36 {
37 class InputStream;
38
39 //! a small class used to find extended attributes ( if possible )
40 class XAttr
41 {
42 public:
43 //! constructor
44 explicit XAttr(char const *path)
45 : m_fName("")
46 {
47 if (path) m_fName=path;
48 }
49
50 /** return a inputstream corresponding to a attr or 0
51
52 \note if not 0, the caller is responsible of it (ie. must remove it)*/
53 InputStream *getStream(const char *attr) const;
54 protected:
55 /** try to find a FINDER.DAT file and returns the fileInformation/ressource fork data
56 \note OS9 method to store a file in a FAT disk */
57 InputStream *getUsingFinderDat(char const *what) const;
58 /** try to look for a possible file containing fileInfo/resource */
59 InputStream *getAuxillarInput() const;
60 /** try to find a possible fork in a stream */
61 InputStream *unMacMIME(InputStream *inp, char const *what) const;
62
63 //! the file name
64 std::string m_fName;
65 };
66 }
67 #endif
68
69 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab: