This file is indexed.

/usr/include/k3bdatadoc.h is in libk3b-dev 2.0.3-0ubuntu5.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
/*
 *
 * Copyright (C) 2003-2009 Sebastian Trueg <trueg@k3b.org>
 *
 * This file is part of the K3b project.
 * Copyright (C) 1998-2009 Sebastian Trueg <trueg@k3b.org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * See the file "COPYING" for the exact licensing terms.
 */


#ifndef K3BDATADOC_H
#define K3BDATADOC_H

#include "k3bdoc.h"

#include <kio/global.h>

#include "k3b_export.h"

class QString;
class QDomDocument;
class QDomElement;

namespace K3b {
    class DataItem;
    class RootItem;
    class DirItem;
    class Job;
    class BootItem;
    class Iso9660Directory;
    class IsoOptions;

    namespace Device {
        class Device;
    }


    /**
     *@author Sebastian Trueg
     */
    class LIBK3B_EXPORT DataDoc : public Doc
    {
        Q_OBJECT

    public:
        DataDoc( QObject* parent = 0 );
        virtual ~DataDoc();

        virtual Type type() const { return DataProject; }
        virtual QString typeString() const { return QString::fromLatin1("data"); }

        virtual QString name() const;

        /**
         * The spported media types based on the project size
         * and settings (example: if writing mode == TAO we force
         * CD media)
         */
        virtual Device::MediaTypes supportedMediaTypes() const;

        enum MultiSessionMode {
            /**
             * Let the DataJob decide if to close the CD or not.
             * The decision is based on the state of the inserted media
             * (appendable/closed), the size of the project (will it fill
             * up the CD?), and the free space on the inserted media.
             */
            AUTO,
            NONE,
            START,
            CONTINUE,
            FINISH
        };

        RootItem* root() const;

        virtual bool newDocument();
        virtual void clear();

        virtual KIO::filesize_t size() const;

        /**
         * This is used for multisession where size() also returnes the imported session's size
         */
        virtual KIO::filesize_t burningSize() const;
        virtual Msf length() const;
        virtual Msf burningLength() const;

        /**
         * Simply deletes the item if it is removable (meaning isRemovable() returns true.
         * Be aware that you can remove items simply by deleting them even if isRemovable()
         * returns false.
         */
        void removeItem( DataItem* item );

        /**
         * Simply calls reparent.
         */
        void moveItem( DataItem* item, DirItem* newParent );
        void moveItems( const QList<DataItem*>& itemList, DirItem* newParent );

        DirItem* addEmptyDir( const QString& name, DirItem* parent );

        QString treatWhitespace( const QString& );

        virtual BurnJob* newBurnJob( JobHandler* hdl, QObject* parent = 0 );

        MultiSessionMode multiSessionMode() const;
        void setMultiSessionMode( MultiSessionMode mode );

        int dataMode() const;
        void setDataMode( int m );

        void setVerifyData( bool b );
        bool verifyData() const;

        static bool nameAlreadyInDir( const QString&, DirItem* );

        /**
         * Most of the options that map to the mkisofs parameters are grouped
         * together in the IsoOptions class to allow easy saving to and loading
         * from a KConfig object.
         */
        const IsoOptions& isoOptions() const;
        void setIsoOptions( const IsoOptions& isoOptions );

        QList<BootItem*> bootImages();
        DataItem* bootCataloge();

        DirItem* bootImageDir();

        /**
         * Create a boot item and also create a boot catalogue file in case none
         * exists in the project.
         *
         * Calling this method has the same effect like creating a new BootItem
         * instance manually and then calling createBootCatalogeItem.
         *
         * \return The new boot item on success or 0 in case a file with the same
         *         name already exists.
         */
        BootItem* createBootItem( const QString& filename, DirItem* bootDir = 0 );

        /**
         * Create a new boot catalog item.
         * For now this is not called automatically for internal reasons.
         *
         * Call this if you create boot items manually instead of using createBootItem.
         *
         * The boot catalog is automatically deleted once the last boot item is removed
         * from the doc.
         *
         * \return The new boot catalog item or the old one if it already exists.
         */
        DataItem* createBootCatalogeItem( DirItem* bootDir );

        /**
         * This will prepare the filenames as written to the image.
         * These filenames are saved in DataItem::writtenName
         */
        void prepareFilenames();

        /**
         * Returns true if filenames need to be cut due to the limitations of Joliet.
         *
         * This is only valid after a call to @p prepareFilenames()
         */
        bool needToCutFilenames() const;

        QList<DataItem*> needToCutFilenameItems() const;

        /**
         * Imports a session into the project. This will create SessionImportItems
         * and properly set the imported session size.
         * Some settings will be adjusted to the imported session (joliet, rr).
         *
         * Be aware that this method is blocking.
         *
         * \return true if the old session was successfully imported, false if no
         *         session could be found.
         *
         * \see clearImportedSession()
         */
        bool importSession( Device::Device*, int session );

        /**
         * The session number that has been imported.
         * \return The number of the imported session or 0 if no session information
         * was available (last track imported) or -1 if no session was imported.
         */
        int importedSession() const;

        /**
         * Searches for an item by it's local path.
         *
         * NOT IMPLEMENTED YET!
         *
         * \return The items that correspond to the specified local path.
         */
        QList<DataItem*> findItemByLocalPath( const QString& path ) const;

    public Q_SLOTS:
        virtual void addUrls( const KUrl::List& urls );

        /**
         * Add urls syncroneously
         * This method adds files recursively including symlinks, hidden, and system files.
         * If a file already exists the new file's name will be appended a number.
         */
        virtual void addUrlsToDir( const KUrl::List& urls, K3b::DirItem* dir );

        void clearImportedSession();

        /**
         * Just a convience method to prevent using setIsoOptions for this
         * often used value.
         */
        void setVolumeID( const QString& );

    Q_SIGNALS:
        void aboutToRemoveItem( K3b::DataItem* );
        void aboutToAddItem( K3b::DirItem* futureParent, K3b::DataItem* );
        void itemRemoved( K3b::DataItem* );
        void itemAdded( K3b::DataItem* );
        void volumeIdChanged();
        void importedSessionChanged( int importedSession );

    protected:
        /** reimplemented from Doc */
        virtual bool loadDocumentData( QDomElement* root );
        /** reimplemented from Doc */
        virtual bool saveDocumentData( QDomElement* );

        void saveDocumentDataOptions( QDomElement& optionsElem );
        void saveDocumentDataHeader( QDomElement& headerElem );
        bool loadDocumentDataOptions( QDomElement optionsElem );
        bool loadDocumentDataHeader( QDomElement optionsElem );

    private:
        void prepareFilenamesInDir( DirItem* dir );
        void createSessionImportItems( const Iso9660Directory*, DirItem* parent );

        /**
         * used by DirItem to inform about removed items.
         */
        void aboutToRemoveItemFromDir( DirItem* parent, DataItem* removedItem );
        void aboutToAddItemToDir( DirItem* parent, DataItem* addedItem );
        void itemRemovedFromDir( DirItem* parent, DataItem* removedItem );
        void itemAddedToDir( DirItem* parent, DataItem* addedItem );

        /**
         * load recursivly
         */
        bool loadDataItem( QDomElement& e, DirItem* parent );
        /**
         * save recursivly
         */
        void saveDataItem( DataItem* item, QDomDocument* doc, QDomElement* parent );

        void informAboutNotFoundFiles();

        class Private;
        Private* d;

        friend class MixedDoc;
        friend class DirItem;
    };
}

#endif