SOL9 2.0 Class: FileInfo

 SOL9 C++ Class Library  SOL9 Samples  SOL9 Tutorial  SOL9 FAQ  SOL9 ClassTree 

Source code

/*
 * FileInfo.h 
 * Copyright (c) 2011 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED. 
 */


#pragma once

#include <sol/nm/NetInfo.h>

namespace SOL {

class FileInfo: public NetInfo {

public:
    /**
     * Constructor
     */
    FileInfo(int lv=0)
    :NetInfo(lv)
    {
    }

public:
    /**
     * Destructor
     */
    ~FileInfo()
    {
    }

protected:
    const wchar_t* getPermission(DWORD value, __out StringBufferT<wchar_t>& buffer)
    {
        static const ArgT<wchar_t> types[] = {
            {L"FILE_READ", PERM_FILE_READ},        //Permission to read a resource and, by default, execute the resource.
            {L"FILE_WRITE",PERM_FILE_WRITE},    //Permission to write to a resource.
            {L"FILE_CREATE",PERM_FILE_CREATE}    //Permission to create a resource; data can be written when creating the resource.
         };

        int count = XtNumber(types);
        int matched = 0;
        for (int i = 0; i<count; i++) {
            if (types[i].value & value) {
                if (matched>0) {
                    buffer.append(L" | ");
                }
                buffer.append(types[i].name);
                matched++;
            }
        }
        return (const wchar_t*)buffer;
    }

};

}

Last modified: 1 Feb 2012

Copyright (c) 2009-2012 Antillia.com ALL RIGHTS RESERVED.