Main Page | Class Hierarchy | Data Structures | File List | Data Fields | Globals | Related Pages

AdvFileAttr.h File Reference


Detailed Description

This class provides eMule with functions to handle conversion of files to Sparse files along with file-system level compression/decompression support.

For terms and conditions, read Terms.dox. Distribution is allowed as GPL as long as these comments remain included verbatim.

	
You are free to use and modify this file to the extent allowed by the GPL at the exclusive condition that you send me
a notification of your intent to use or modify this file. Send such notifications to digitalmastrmind_at_hotmail_dot_com
or visit http://pages.infinit.net/moonligh/eMule for other details. I would appreciate it if you would submit
modifications to me for implementation instead of implementing changes yourself. Comments and suggestions are welcome as well.

All disclosed source code is considered GPL'd unless otherwise noted.
All files created specifically for building my Doxygen-based projects web site (.dox) remain my exclusive property.
All my own files contain a reference to this text and should be treated as if this was replicated in each of them.
If you change my files, add comments below my header telling me who you are, what you changed and why so I know who
to give credits to when I update my files.

Modification of this file (Terms.txt) is not allowed.
Distribution is allowed as GPL as long this file is untouched and accompanies my own source files that refer to it.

- Moonlight.

Author:
Moonlight (digitalmastrmind@at@hotmail.dot.com), September-November 2003
Version:
0.70-test1
Note:
This is the real full-Monty Sparse&Compression support job... quite a different story from my MakeSparse() quick hack!

This is the completely rewritten version I started writing about in late October. This version only uses a single thread and an item queue, the whole thing being in WorkQueue.h and WorkQueue.cpp (CWorkQueue and CWorkQueueItem)

Last changed: 2003-11-05 - Finishing up the single-thread + queue re-implementation, you may want to take a look at CWorkQueue and CWorkQueueItem.

Contents:

AdvFileAttr.h

#pragma once

#include "types.h"
#include "WorkQueue.h"

// --> Moonlight: Sparse&Compressed support
// Moonlight: Sparse&Compressed support <--

class CAdvFileAttr : CWorkQueueItem
{
public:
    CAdvFileAttr(CFile *file = NULL);
    ~CAdvFileAttr(void);

public:
    bool        MakeSparse              (bool forceScan = false);
    bool        MakeCompressed          (bool makeCompressed = true);
    void        SetFilePtr              (CFile *file = NULL);
    bool        LoadAttributes          (void);

    void        Cancel                  (void);
    uint32      GetTempFSCappabilities  (void)  {return m_TempFSCapabilities;}
    uint32      GetFileAttributes       (void)  {return m_FileAttributes;}

    bool        isSparse            (void)      {return (m_FileAttributes & FILE_ATTRIBUTE_SPARSE_FILE) != 0;}
    bool        isCompressed        (void)      {return (m_FileAttributes & FILE_ATTRIBUTE_COMPRESSED) != 0;}
    bool        isFSSparse          (void)      {return (m_TempFSCapabilities & FILE_SUPPORTS_SPARSE_FILES) != 0;}
    bool        isFSCompressed      (void)      {return (m_TempFSCapabilities & FILE_FILE_COMPRESSION) != 0;}
    bool        isBusy              (void)      {return m_LastOp != TOps_Nothing;}
    bool        isCancel            (void)      {return m_LastOp == TOps_Cancel;}

    void        ThreadWork          (void);

private:
    bool        WorkSparse          (void);
    void        WorkCompress        (void);
    void        QueueDelCB          (void)  {m_LastOp = TOps_Nothing;}

private:
    static      CWorkQueue          m_WorkQueue;

    enum {
        TOps_Nothing,
        TOps_Compress,
        TOps_Sparse,
        TOps_Cancel
    } m_LastOp;
    
    uint32              m_FileAttributes;
    uint32              m_TempFSCapabilities;
    CFile               *m_pCFile;
};

#include "types.h"
#include "WorkQueue.h"

Go to the source code of this file.

Data Structures

class  CAdvFileAttr


Generated on Wed Nov 5 05:48:08 2003 for Moonlight's eMule Tweaks Documentation by doxygen 1.3.4