Ticket #7453: storage-cleanup.diff

File storage-cleanup.diff, 32.4 KB (added by Barrett, 14 years ago)
  • src/kits/storage/Entry.cpp

     
    643643    - "error code" - Failure
    644644*/
    645645status_t
    646 BEntry::GetName(char *buffer) const
     646BEntry::GetName(char* buffer) const
    647647{
    648648    status_t result = B_ERROR;
    649649
     
    681681
    682682*/
    683683status_t
    684 BEntry::Rename(const char *path, bool clobber)
     684BEntry::Rename(const char* path, bool clobber)
    685685{
    686686    // check parameter and initialization
    687687    if (path == NULL)
     
    780780        \c false - The BEntry objects refer to different entries
    781781 */
    782782bool
    783 BEntry::operator==(const BEntry &item) const
     783BEntry::operator==(const BEntry& item) const
    784784{
    785785    // First check statuses
    786786    if (this->InitCheck() != B_OK && item.InitCheck() != B_OK) {
     
    951951                // if no directory was given, we need to open the current dir
    952952                // now
    953953                if (dirFD < 0) {
    954                     char *cwd = getcwd(tmpPath, B_PATH_NAME_LENGTH);
     954                    char* cwd = getcwd(tmpPath, B_PATH_NAME_LENGTH);
    955955                    if (!cwd)
    956956                        return B_ERROR;
    957957                    dirFD = _kern_open_dir(-1, cwd);
  • src/kits/storage/FindDirectory.cpp

     
    2525    - another error code
    2626*/
    2727status_t
    28 find_directory(directory_which which, BPath *path, bool createIt,
    29                BVolume *volume)
     28find_directory(directory_which which, BPath* path, bool createIt,
     29               BVolume* volume)
    3030{
    3131    if (path == NULL)
    3232        return B_BAD_VALUE;
  • src/kits/storage/FileDescriptorIO.cpp

     
    2828
    2929
    3030ssize_t
    31 BFileDescriptorIO::Read(void *buffer, size_t size)
     31BFileDescriptorIO::Read(void* buffer, size_t size)
    3232{
    3333    ssize_t bytesRead = read(fFD, buffer, size);
    3434    return bytesRead >= 0 ? bytesRead : errno;
     
    3636
    3737
    3838ssize_t
    39 BFileDescriptorIO::Write(const void *buffer, size_t size)
     39BFileDescriptorIO::Write(const void* buffer, size_t size)
    4040{
    4141    ssize_t bytesWritten = write(fFD, buffer, size);
    4242    return bytesWritten >= 0 ? bytesWritten : errno;
     
    4444
    4545
    4646ssize_t
    47 BFileDescriptorIO::ReadAt(off_t position, void *buffer, size_t size)
     47BFileDescriptorIO::ReadAt(off_t position, void* buffer, size_t size)
    4848{
    4949    ssize_t bytesRead = pread(fFD, buffer, size, position);
    5050    return bytesRead >= 0 ? bytesRead : errno;
     
    5252
    5353
    5454ssize_t
    55 BFileDescriptorIO::WriteAt(off_t position, const void *buffer, size_t size)
     55BFileDescriptorIO::WriteAt(off_t position, const void* buffer, size_t size)
    5656{
    5757    ssize_t bytesWritten = pwrite(fFD, buffer, size, position);
    5858    return bytesWritten >= 0 ? bytesWritten : errno;
  • src/kits/storage/disk_device/DiskDeviceTypes.cpp

     
    1414
    1515// Device Types
    1616
    17 const char *kDeviceTypeFloppyDisk       = FLOPPY_DEVICE_NAME;
    18 const char *kDeviceTypeHardDisk         = HARD_DISK_DEVICE_NAME;
    19 const char *kDeviceTypeOptical          = OPTICAL_DEVICE_NAME;
     17const char* kDeviceTypeFloppyDisk       = FLOPPY_DEVICE_NAME;
     18const char* kDeviceTypeHardDisk         = HARD_DISK_DEVICE_NAME;
     19const char* kDeviceTypeOptical          = OPTICAL_DEVICE_NAME;
    2020
    2121// Partition types
    2222
    23 const char *kPartitionTypeUnrecognized  = UNRECOGNIZED_PARTITION_NAME;
     23const char* kPartitionTypeUnrecognized  = UNRECOGNIZED_PARTITION_NAME;
    2424
    25 const char *kPartitionTypeMultisession  = MULTISESSION_PARTITION_NAME;
    26 const char *kPartitionTypeAudioSession  = AUDIO_SESSION_PARTITION_NAME;
    27 const char *kPartitionTypeDataSession   = DATA_SESSION_PARTITION_NAME;
     25const char* kPartitionTypeMultisession  = MULTISESSION_PARTITION_NAME;
     26const char* kPartitionTypeAudioSession  = AUDIO_SESSION_PARTITION_NAME;
     27const char* kPartitionTypeDataSession   = DATA_SESSION_PARTITION_NAME;
    2828
    29 const char *kPartitionTypeAmiga         = AMIGA_PARTITION_NAME;
    30 const char *kPartitionTypeApple         = APPLE_PARTITION_NAME;
    31 const char *kPartitionTypeEFI           = EFI_PARTITION_NAME;
    32 const char *kPartitionTypeIntel         = INTEL_PARTITION_NAME;
    33 const char *kPartitionTypeIntelExtended = INTEL_EXTENDED_PARTITION_NAME;
    34 const char *kPartitionTypeVMDK          = VMDK_PARTITION_NAME;
     29const char* kPartitionTypeAmiga         = AMIGA_PARTITION_NAME;
     30const char* kPartitionTypeApple         = APPLE_PARTITION_NAME;
     31const char* kPartitionTypeEFI           = EFI_PARTITION_NAME;
     32const char* kPartitionTypeIntel         = INTEL_PARTITION_NAME;
     33const char* kPartitionTypeIntelExtended = INTEL_EXTENDED_PARTITION_NAME;
     34const char* kPartitionTypeVMDK          = VMDK_PARTITION_NAME;
    3535
    36 const char *kPartitionTypeAmigaFFS      = AMIGA_FFS_NAME;
    37 const char *kPartitionTypeBFS           = BFS_NAME;
    38 const char *kPartitionTypeBTRFS         = BTRFS_NAME;
    39 const char *kPartitionTypeEXFAT         = EXFAT_FS_NAME;
    40 const char *kPartitionTypeEXT2          = EXT2_FS_NAME;
    41 const char *kPartitionTypeEXT3          = EXT3_FS_NAME;
    42 const char *kPartitionTypeFAT12         = FAT12_FS_NAME;
    43 const char *kPartitionTypeFAT32         = FAT32_FS_NAME;
    44 const char *kPartitionTypeHFS           = HFS_NAME;
    45 const char *kPartitionTypeHFSPlus       = HFS_PLUS_NAME;
    46 const char *kPartitionTypeISO9660       = ISO9660_FS_NAME;
    47 const char *kPartitionTypeReiser        = REISER_FS_NAME;
    48 const char *kPartitionTypeUDF           = UDF_FS_NAME;
     36const char* kPartitionTypeAmigaFFS      = AMIGA_FFS_NAME;
     37const char* kPartitionTypeBFS           = BFS_NAME;
     38const char* kPartitionTypeBTRFS         = BTRFS_NAME;
     39const char* kPartitionTypeEXFAT         = EXFAT_FS_NAME;
     40const char* kPartitionTypeEXT2          = EXT2_FS_NAME;
     41const char* kPartitionTypeEXT3          = EXT3_FS_NAME;
     42const char* kPartitionTypeFAT12         = FAT12_FS_NAME;
     43const char* kPartitionTypeFAT32         = FAT32_FS_NAME;
     44const char* kPartitionTypeHFS           = HFS_NAME;
     45const char* kPartitionTypeHFSPlus       = HFS_PLUS_NAME;
     46const char* kPartitionTypeISO9660       = ISO9660_FS_NAME;
     47const char* kPartitionTypeReiser        = REISER_FS_NAME;
     48const char* kPartitionTypeUDF           = UDF_FS_NAME;
  • src/kits/storage/disk_device/PartitionDelegate.cpp

     
    2121
    2222// constructor
    2323BPartition::Delegate::Delegate(BPartition* partition)
    24     : fPartition(partition),
    25       fMutablePartition(this),
    26       fDiskSystem(NULL),
    27       fPartitionHandle(NULL)
     24    :
     25    fPartition(partition),
     26    fMutablePartition(this),
     27    fDiskSystem(NULL),
     28    fPartitionHandle(NULL)
    2829{
    2930}
    3031
     
    359360
    360361// GetNextSupportedChildType
    361362status_t
    362 BPartition::Delegate::GetNextSupportedChildType(Delegate* child, int32 *cookie,
    363     BString* type) const
     363BPartition::Delegate::GetNextSupportedChildType(Delegate* child,
     364    int32* cookie, BString* type) const
    364365{
    365366    TRACE("%p->BPartition::Delegate::GetNextSupportedChildType(child: %p, "
    366367        "cookie: %ld)\n", this, child, *cookie);
     
    377378
    378379// IsSubSystem
    379380bool
    380 BPartition::Delegate::IsSubSystem(Delegate* child, const char* diskSystem) const
     381BPartition::Delegate::IsSubSystem(Delegate* child,
     382    const char* diskSystem) const
    381383{
    382384    // get the disk system add-on
    383385    DiskSystemAddOnManager* manager = DiskSystemAddOnManager::Default();
  • src/kits/storage/disk_device/DiskDeviceJob.cpp

     
    1111// constructor
    1212DiskDeviceJob::DiskDeviceJob(PartitionReference* partition,
    1313        PartitionReference* child)
    14     : fPartition(partition),
    15       fChild(child)
     14    :
     15    fPartition(partition),
     16    fChild(child)
    1617{
    1718    if (fPartition)
    1819        fPartition->AcquireReference();
  • src/kits/storage/disk_device/DiskSystemAddOn.cpp

     
    1414
    1515// constructor
    1616BDiskSystemAddOn::BDiskSystemAddOn(const char* name, uint32 flags)
    17     : fName(name),
    18       fFlags(flags)
     17    :
     18    fName(name),
     19    fFlags(flags)
    1920{
    2021}
    2122
     
    9899
    99100// constructor
    100101BPartitionHandle::BPartitionHandle(BMutablePartition* partition)
    101     : fPartition(partition)
     102    :
     103    fPartition(partition)
    102104{
    103105}
    104106
  • src/kits/storage/disk_device/PartitionDelegate.h

     
    7575                                    B_PARAMETER_EDITOR_TYPE type,
    7676                                    BPartitionParameterEditor** editor) const;
    7777            status_t            GetNextSupportedChildType(Delegate* child,
    78                                     int32 *cookie, BString* type) const;
     78                                    int32* cookie, BString* type) const;
    7979            bool                IsSubSystem(Delegate* child,
    8080                                    const char* diskSystem) const;
    8181
  • src/kits/storage/disk_device/DiskDevice.cpp

     
    4747/*! \brief Creates an uninitialized BDiskDevice object.
    4848*/
    4949BDiskDevice::BDiskDevice()
    50     : fDeviceData(NULL)
     50    :
     51    fDeviceData(NULL)
    5152{
    5253}
    5354
     
    223224        return false;
    224225
    225226    struct IsModifiedVisitor : public BDiskDeviceVisitor {
    226         virtual bool Visit(BDiskDevice *device)
     227        virtual bool Visit(BDiskDevice* device)
    227228        {
    228229            return Visit(device, 0);
    229230        }
    230231
    231         virtual bool Visit(BPartition *partition, int32 level)
     232        virtual bool Visit(BPartition* partition, int32 level)
    232233        {
    233234            return partition->_IsModified();
    234235        }
  • src/kits/storage/disk_device/DiskScannerAddOn.cpp

     
    1515{
    1616}
    1717
     18
    1819// destructor
    1920/*! \brief Frees all resources associated with this object.
    2021*/
     
    7172{
    7273}
    7374
     75
    7476// destructor
    7577/*! \brief Frees all resources associated with this object.
    7678*/
     
    128130{
    129131}
    130132
     133
    131134// destructor
    132135/*! \brief Frees all resources associated with this object.
    133136*/
     
    135138{
    136139}
    137140
     141
    138142/*! \brief Returns a view containing the controls needed for editing the
    139143           parameters.
    140144
     
    155159    return NULL;
    156160}
    157161
     162
    158163// EditingDone
    159164/*! \brief Called when the user finishes editing the parameters.
    160165
     
    174179    return true;
    175180}
    176181
     182
    177183/*! \brief Returns the edited parameters.
    178184
    179185    To be overridden by derived classes.
  • src/kits/storage/disk_device/jobs/RepairJob.cpp

     
    1212
    1313// constructor
    1414RepairJob::RepairJob(PartitionReference* partition, bool checkOnly)
    15     : DiskDeviceJob(partition),
    16       fCheckOnly(checkOnly)
     15    :
     16    DiskDeviceJob(partition),
     17    fCheckOnly(checkOnly)
    1718{
    1819}
    1920
  • src/kits/storage/disk_device/jobs/ResizeJob.cpp

     
    1414// constructor
    1515ResizeJob::ResizeJob(PartitionReference* partition, PartitionReference* child,
    1616        off_t size, off_t contentSize)
    17     : DiskDeviceJob(partition, child),
    18       fSize(size),
    19       fContentSize(contentSize)
     17    :
     18    DiskDeviceJob(partition, child),
     19    fSize(size),
     20    fContentSize(contentSize)
    2021{
    2122}
    2223
  • src/kits/storage/disk_device/PartitioningInfo.cpp

     
    2828
    2929// constructor
    3030BPartitioningInfo::BPartitioningInfo()
    31     : fPartitionID(-1),
    32       fSpaces(NULL),
    33       fCount(0),
    34       fCapacity(0)
     31    :
     32    fPartitionID(-1),
     33    fSpaces(NULL),
     34    fCount(0),
     35    fCapacity(0)
    3536{
    3637}
    3738
     
    188189
    189190// GetPartitionableSpaceAt
    190191status_t
    191 BPartitioningInfo::GetPartitionableSpaceAt(int32 index, off_t *offset,
     192BPartitioningInfo::GetPartitionableSpaceAt(int32 index, off_t* offset,
    192193                                           off_t *size) const
    193194{
    194195    if (!fSpaces)
  • src/kits/storage/AddOnMonitorHandler.cpp

     
    213213
    214214
    215215void
    216 AddOnMonitorHandler::EntryMoved(const char *name, const char *fromName,
     216AddOnMonitorHandler::EntryMoved(const char* name, const char* fromName,
    217217    ino_t fromDirectory, ino_t toDirectory, dev_t device, ino_t node,
    218218    dev_t nodeDevice)
    219219{
  • src/kits/storage/AddOnImage.h

     
    1515    AddOnImage();
    1616    ~AddOnImage();
    1717
    18     status_t Load(const char *path);
     18    status_t Load(const char* path);
    1919    void Unload();
    2020
    2121    void SetID(image_id id);
  • src/kits/storage/FileIO.cpp

     
    2626
    2727
    2828ssize_t
    29 BFileIO::Read(void *buffer, size_t size)
     29BFileIO::Read(void* buffer, size_t size)
    3030{
    3131    errno = B_OK;
    3232    ssize_t bytesRead = fread(buffer, 1, size, fFile);
     
    3535
    3636
    3737ssize_t
    38 BFileIO::Write(const void *buffer, size_t size)
     38BFileIO::Write(const void* buffer, size_t size)
    3939{
    4040    errno = B_OK;
    4141    ssize_t bytesRead = fwrite(buffer, 1, size, fFile);
     
    4444
    4545
    4646ssize_t
    47 BFileIO::ReadAt(off_t position, void *buffer, size_t size)
     47BFileIO::ReadAt(off_t position, void* buffer, size_t size)
    4848{
    4949    // save the old position and seek to the requested one
    5050    off_t oldPosition = _Seek(position, SEEK_SET);
     
    6262
    6363
    6464ssize_t
    65 BFileIO::WriteAt(off_t position, const void *buffer, size_t size)
     65BFileIO::WriteAt(off_t position, const void* buffer, size_t size)
    6666{
    6767    // save the old position and seek to the requested one
    6868    off_t oldPosition = _Seek(position, SEEK_SET);
  • src/kits/storage/File.cpp

     
    3434/*! If \a file is uninitialized, the newly constructed BFile will be, too.
    3535    \param file the BFile object to be copied
    3636*/
    37 BFile::BFile(const BFile &file)
     37BFile::BFile(const BFile& file)
    3838    :
    3939    fMode(0)
    4040{
     
    4848    \param openMode the mode in which the file should be opened
    4949    \see SetTo() for values for \a openMode
    5050*/
    51 BFile::BFile(const entry_ref *ref, uint32 openMode)
     51BFile::BFile(const entry_ref* ref, uint32 openMode)
    5252    :
    5353    fMode(0)
    5454{
     
    6262    \param openMode the mode in which the file should be opened
    6363    \see SetTo() for values for \a openMode
    6464*/
    65 BFile::BFile(const BEntry *entry, uint32 openMode)
     65BFile::BFile(const BEntry* entry, uint32 openMode)
    6666    :
    6767    fMode(0)
    6868{
     
    7676    \param openMode the mode in which the file should be opened
    7777    \see SetTo() for values for \a openMode
    7878*/
    79 BFile::BFile(const char *path, uint32 openMode)
     79BFile::BFile(const char* path, uint32 openMode)
    8080    :
    8181    fMode(0)
    8282{
     
    9393    \param openMode the mode in which the file should be opened
    9494    \see SetTo() for values for \a openMode
    9595*/
    96 BFile::BFile(const BDirectory *dir, const char *path, uint32 openMode)
     96BFile::BFile(const BDirectory *dir, const char* path, uint32 openMode)
    9797    :
    9898    fMode(0)
    9999{
     
    143143    - \c B_NO_MORE_FDS: The application has run out of file descriptors.
    144144*/
    145145status_t
    146 BFile::SetTo(const entry_ref *ref, uint32 openMode)
     146BFile::SetTo(const entry_ref* ref, uint32 openMode)
    147147{
    148148    Unset();
    149149
     
    188188          to reimplement!
    189189*/
    190190status_t
    191 BFile::SetTo(const BEntry *entry, uint32 openMode)
     191BFile::SetTo(const BEntry* entry, uint32 openMode)
    192192{
    193193    Unset();
    194194
     
    229229    - \c B_NO_MORE_FDS: The application has run out of file descriptors.
    230230*/
    231231status_t
    232 BFile::SetTo(const char *path, uint32 openMode)
     232BFile::SetTo(const char* path, uint32 openMode)
    233233{
    234234    Unset();
    235235
     
    271271          to reimplement!
    272272*/
    273273status_t
    274 BFile::SetTo(const BDirectory *dir, const char *path, uint32 openMode)
     274BFile::SetTo(const BDirectory* dir, const char* path, uint32 openMode)
    275275{
    276276    Unset();
    277277
     
    326326    \return the number of bytes actually read or an error code
    327327*/
    328328ssize_t
    329 BFile::Read(void *buffer, size_t size)
     329BFile::Read(void* buffer, size_t size)
    330330{
    331331    if (InitCheck() != B_OK)
    332332        return InitCheck();
     
    343343    \return the number of bytes actually read or an error code
    344344*/
    345345ssize_t
    346 BFile::ReadAt(off_t location, void *buffer, size_t size)
     346BFile::ReadAt(off_t location, void* buffer, size_t size)
    347347{
    348348    if (InitCheck() != B_OK)
    349349        return InitCheck();
     
    360360    \return the number of bytes actually written or an error code
    361361*/
    362362ssize_t
    363 BFile::Write(const void *buffer, size_t size)
     363BFile::Write(const void* buffer, size_t size)
    364364{
    365365    if (InitCheck() != B_OK)
    366366        return InitCheck();
     
    377377    \return the number of bytes actually written or an error code
    378378*/
    379379ssize_t
    380 BFile::WriteAt(off_t location, const void *buffer, size_t size)
     380BFile::WriteAt(off_t location, const void* buffer, size_t size)
    381381{
    382382    if (InitCheck() != B_OK)
    383383        return InitCheck();
  • src/kits/storage/AddOnImage.cpp

     
    55
    66#include "AddOnImage.h"
    77
     8
    89// constructor
    910AddOnImage::AddOnImage()
    1011    : fID(-1)
    1112{
    1213}
    1314
     15
    1416// destructor
    1517AddOnImage::~AddOnImage()
    1618{
    1719    Unload();
    1820}
    1921
     22
    2023// Load
    2124status_t
    22 AddOnImage::Load(const char *path)
     25AddOnImage::Load(const char* path)
    2326{
    2427    Unload();
    2528    status_t error = (path ? B_OK : B_BAD_VALUE);
     
    3336    return error;
    3437}
    3538
     39
    3640// Unload
    3741void
    3842AddOnImage::Unload()
     
    4347    }
    4448}
    4549
     50
    4651// SetID
    4752void
    4853AddOnImage::SetID(image_id id)
     
    5156    if (id >= 0)
    5257        fID = id;
    5358}
    54 
  • src/kits/storage/AppFileInfo.cpp

     
    2626using namespace std;
    2727
    2828// attributes
    29 static const char *kTypeAttribute               = "BEOS:TYPE";
    30 static const char *kSignatureAttribute          = "BEOS:APP_SIG";
    31 static const char *kAppFlagsAttribute           = "BEOS:APP_FLAGS";
    32 static const char *kSupportedTypesAttribute     = "BEOS:FILE_TYPES";
    33 static const char *kVersionInfoAttribute        = "BEOS:APP_VERSION";
    34 static const char *kMiniIconAttribute           = "BEOS:M:";
    35 static const char *kLargeIconAttribute          = "BEOS:L:";
    36 static const char *kIconAttribute               = "BEOS:";
    37 static const char *kStandardIconType            = "STD_ICON";
    38 static const char *kIconType                    = "ICON";
    39 static const char *kCatalogEntryAttribute       = "SYS:NAME";
     29static const char* kTypeAttribute               = "BEOS:TYPE";
     30static const char* kSignatureAttribute          = "BEOS:APP_SIG";
     31static const char* kAppFlagsAttribute           = "BEOS:APP_FLAGS";
     32static const char* kSupportedTypesAttribute     = "BEOS:FILE_TYPES";
     33static const char* kVersionInfoAttribute        = "BEOS:APP_VERSION";
     34static const char* kMiniIconAttribute           = "BEOS:M:";
     35static const char* kLargeIconAttribute          = "BEOS:L:";
     36static const char* kIconAttribute               = "BEOS:";
     37static const char* kStandardIconType            = "STD_ICON";
     38static const char* kIconType                    = "ICON";
     39static const char* kCatalogEntryAttribute       = "SYS:NAME";
    4040
    4141// resource IDs
    4242static const int32 kTypeResourceID              = 2;
     
    7575/*! \brief Creates an uninitialized BAppFileInfo object.
    7676*/
    7777BAppFileInfo::BAppFileInfo()
    78     : fResources(NULL),
     78    :
     79    fResources(NULL),
    7980    fWhere(B_USE_BOTH_LOCATIONS)
    8081{
    8182}
    8283
     84
    8385// constructor
    8486/*! \brief Creates an BAppFileInfo object and initializes it to the supplied
    8587           file.
     
    9092
    9193    \param file The file the object shall be initialized to.
    9294*/
    93 BAppFileInfo::BAppFileInfo(BFile *file)
    94     : fResources(NULL),
     95BAppFileInfo::BAppFileInfo(BFile* file)
     96    :
     97    fResources(NULL),
    9598    fWhere(B_USE_BOTH_LOCATIONS)
    9699{
    97100    SetTo(file);
    98101}
    99102
     103
    100104// destructor
    101105/*! \brief Frees all resources associated with this object.
    102106
     
    107111    delete fResources;
    108112}
    109113
     114
    110115// SetTo
    111116/*! \brief Initializes the BAppFileInfo to the supplied file.
    112117
     
    174179    return error;
    175180}
    176181
     182
    177183// GetType
    178184/*! \brief Gets the file's MIME type.
    179185
     
    213219    return error;
    214220}
    215221
     222
    216223// SetType
    217224/*! \brief Sets the file's MIME type.
    218225
     
    228235    - other error codes
    229236*/
    230237status_t
    231 BAppFileInfo::SetType(const char *type)
     238BAppFileInfo::SetType(const char* type)
    232239{
    233240    // check initialization
    234241    status_t error = B_OK;
     
    251258    return error;
    252259}
    253260
     261
    254262// GetSignature
    255263/*! \brief Gets the file's application signature.
    256264
     
    268276    - other error codes
    269277*/
    270278status_t
    271 BAppFileInfo::GetSignature(char *signature) const
     279BAppFileInfo::GetSignature(char* signature) const
    272280{
    273281    // check param and initialization
    274282    status_t error = (signature ? B_OK : B_BAD_VALUE);
     
    278286    size_t read = 0;
    279287    if (error == B_OK) {
    280288        error = _ReadData(kSignatureAttribute, kSignatureResourceID,
    281                           B_MIME_STRING_TYPE, signature, B_MIME_TYPE_LENGTH,
    282                           read);
     289                          B_MIME_STRING_TYPE, signature,
     290                          B_MIME_TYPE_LENGTH, read);
    283291    }
    284292    // check the read data -- null terminate the string
    285293    if (error == B_OK && signature[read - 1] != '\0') {
     
    291299    return error;
    292300}
    293301
     302
    294303// SetSignature
    295304/*! \brief Sets the file's application signature.
    296305
     
    306315    - other error codes
    307316*/
    308317status_t
    309 BAppFileInfo::SetSignature(const char *signature)
     318BAppFileInfo::SetSignature(const char* signature)
    310319{
    311320    // check initialization
    312321    status_t error = B_OK;
     
    388397    - other error codes
    389398*/
    390399status_t
    391 BAppFileInfo::SetCatalogEntry(const char *catalogEntry)
     400BAppFileInfo::SetCatalogEntry(const char* catalogEntry)
    392401{
    393402    if (InitCheck() != B_OK)
    394403        return B_NO_INIT;
     
    420429    - other error codes
    421430*/
    422431status_t
    423 BAppFileInfo::GetAppFlags(uint32 *flags) const
     432BAppFileInfo::GetAppFlags(uint32* flags) const
    424433{
    425434    // check param and initialization
    426435    status_t error = (flags ? B_OK : B_BAD_VALUE);
     
    439448    return error;
    440449}
    441450
     451
    442452// SetAppFlags
    443453/*! \brief Sets the file's application flags.
    444454    \param flags The application flags to be assigned to the file.
     
    462472    return error;
    463473}
    464474
     475
    465476// RemoveAppFlags
    466477/*! \brief Removes the file's application flags.
    467478    \return
     
    483494    return error;
    484495}
    485496
     497
    486498// GetSupportedTypes
    487499/*! \brief Gets the MIME types supported by the application.
    488500
     
    501513    - other error codes
    502514*/
    503515status_t
    504 BAppFileInfo::GetSupportedTypes(BMessage *types) const
     516BAppFileInfo::GetSupportedTypes(BMessage* types) const
    505517{
    506518    // check param and initialization
    507519    status_t error = (types ? B_OK : B_BAD_VALUE);
     
    522534    return error;
    523535}
    524536
     537
    525538// SetSupportedTypes
    526539/*! \brief Sets the MIME types supported by the application.
    527540
     
    549562    - other error codes
    550563*/
    551564status_t
    552 BAppFileInfo::SetSupportedTypes(const BMessage *types, bool syncAll)
     565BAppFileInfo::SetSupportedTypes(const BMessage* types, bool syncAll)
    553566{
    554567    // check initialization
    555568    status_t error = B_OK;
     
    562575        error = B_OK;
    563576        if (types) {
    564577            // check param -- supported types must be valid
    565             const char *type;
     578            const char* type;
    566579            for (int32 i = 0;
    567580                 error == B_OK && types->FindString("types", i, &type) == B_OK;
    568581                 i++) {
     
    577590                    error = size;
    578591            }
    579592            // allocate a buffer for the flattened data
    580             char *buffer = NULL;
     593            char* buffer = NULL;
    581594            if (error == B_OK) {
    582595                buffer = new(nothrow) char[size];
    583596                if (!buffer)
     
    603616    return error;
    604617}
    605618
     619
    606620// SetSupportedTypes
    607621/*! \brief Sets the MIME types supported by the application.
    608622
     
    617631    - other error codes
    618632*/
    619633status_t
    620 BAppFileInfo::SetSupportedTypes(const BMessage *types)
     634BAppFileInfo::SetSupportedTypes(const BMessage* types)
    621635{
    622636    return SetSupportedTypes(types, false);
    623637}
    624638
     639
    625640// IsSupportedType
    626641/*! \brief Returns whether the application supports the supplied MIME type.
    627642
     
    633648            the application, \c false otherwise.
    634649*/
    635650bool
    636 BAppFileInfo::IsSupportedType(const char *type) const
     651BAppFileInfo::IsSupportedType(const char* type) const
    637652{
    638653    status_t error = (type ? B_OK : B_BAD_VALUE);
    639654    // get the supported types
     
    647662    // iterate through the supported types
    648663    bool found = false;
    649664    if (error == B_OK) {
    650         const char *supportedType;
     665        const char* supportedType;
    651666        for (int32 i = 0;
    652667             !found && types.FindString("types", i, &supportedType) == B_OK;
    653668             i++) {
     
    658673    return found;
    659674}
    660675
     676
    661677// Supports
    662678/*! \brief Returns whether the application supports the supplied MIME type
    663679           explicitly.
     
    671687            supported by the application, \c false otherwise.
    672688*/
    673689bool
    674 BAppFileInfo::Supports(BMimeType *type) const
     690BAppFileInfo::Supports(BMimeType* type) const
    675691{
    676692    status_t error = (type && type->InitCheck() == B_OK ? B_OK : B_BAD_VALUE);
    677693    // get the supported types
     
    681697    // iterate through the supported types
    682698    bool found = false;
    683699    if (error == B_OK) {
    684         const char *supportedType;
     700        const char* supportedType;
    685701        for (int32 i = 0;
    686702             !found && types.FindString("types", i, &supportedType) == B_OK;
    687703             i++) {
     
    691707    return found;
    692708}
    693709
     710
    694711// GetIcon
    695712/*! \brief Gets the file's icon.
    696713    \param icon A pointer to a pre-allocated BBitmap of the correct dimension
     
    706723    - other error codes
    707724*/
    708725status_t
    709 BAppFileInfo::GetIcon(BBitmap *icon, icon_size which) const
     726BAppFileInfo::GetIcon(BBitmap* icon, icon_size which) const
    710727{
    711728    return GetIconForType(NULL, icon, which);
    712729}
    713730
     731
    714732// GetIcon
    715733/*! \brief Gets the file's icon.
    716734    \param data The pointer in which the flat icon data will be returned.
     
    727745    return GetIconForType(NULL, data, size);
    728746}
    729747
     748
    730749// SetIcon
    731750/*! \brief Sets the file's icon.
    732751
     
    744763    - other error codes
    745764*/
    746765status_t
    747 BAppFileInfo::SetIcon(const BBitmap *icon, icon_size which)
     766BAppFileInfo::SetIcon(const BBitmap* icon, icon_size which)
    748767{
    749768    return SetIconForType(NULL, icon, which);
    750769}
    751770
     771
    752772// SetIcon
    753773/*! \brief Sets the file's icon.
    754774
     
    769789    return SetIconForType(NULL, data, size);
    770790}
    771791
     792
    772793// GetVersionInfo
    773794/*! \brief Gets the file's version info.
    774795    \param info A pointer to a pre-allocated version_info structure into which
     
    784805    - other error codes
    785806*/
    786807status_t
    787 BAppFileInfo::GetVersionInfo(version_info *info, version_kind kind) const
     808BAppFileInfo::GetVersionInfo(version_info* info, version_kind kind) const
    788809{
    789810    // check params and initialization
    790811    if (!info)
     
    829850    return B_OK;
    830851}
    831852
     853
    832854// SetVersionInfo
    833855/*! \brief Sets the file's version info.
    834856
     
    845867    - other error codes
    846868*/
    847869status_t
    848 BAppFileInfo::SetVersionInfo(const version_info *info, version_kind kind)
     870BAppFileInfo::SetVersionInfo(const version_info* info, version_kind kind)
    849871{
    850872    // check initialization
    851873    status_t error = B_OK;
     
    897919    return error;
    898920}
    899921
     922
    900923// GetIconForType
    901924/*! \brief Gets the icon the application provides for a given MIME type.
    902925
     
    10391062    return error;
    10401063}
    10411064
     1065
    10421066// GetIconForType
    10431067/*! \brief Gets the icon the application provides for a given MIME type.
    10441068
     
    10561080    - other error codes
    10571081*/
    10581082status_t
    1059 BAppFileInfo::GetIconForType(const char *type, uint8** data,
     1083BAppFileInfo::GetIconForType(const char* type, uint8** data,
    10601084                             size_t* size) const
    10611085{
    10621086    if (InitCheck() != B_OK)
     
    10891113    return B_OK;
    10901114}
    10911115
     1116
    10921117// SetIconForType
    10931118/*! \brief Sets the icon the application provides for a given MIME type.
    10941119
     
    11131138    - other error codes
    11141139*/
    11151140status_t
    1116 BAppFileInfo::SetIconForType(const char *type, const BBitmap *icon,
     1141BAppFileInfo::SetIconForType(const char* type, const BBitmap* icon,
    11171142                             icon_size which)
    11181143{
    11191144    status_t error = B_OK;
     
    11541179        } else
    11551180            attributeString += kStandardIconType;
    11561181    }
    1157     const char *attribute = attributeString.String();
     1182    const char* attribute = attributeString.String();
    11581183    // check parameter and initialization
    11591184    if (error == B_OK && icon
    11601185        && (icon->InitCheck() != B_OK || icon->Bounds() != bounds)) {
     
    11931218    return error;
    11941219}
    11951220
     1221
    11961222// SetIconForType
    11971223/*! \brief Sets the icon the application provides for a given MIME type.
    11981224
     
    12341260    } else
    12351261        attributeString += kIconType;
    12361262
    1237     const char *attribute = attributeString.String();
     1263    const char* attribute = attributeString.String();
    12381264
    12391265    status_t error;
    12401266    // write/remove the attribute
     
    12541280    return error;
    12551281}
    12561282
     1283
    12571284// SetInfoLocation
    12581285/*! \brief Specifies the location where the meta data shall be stored.
    12591286
     
    12861313    return (fWhere & B_USE_ATTRIBUTES) != 0;
    12871314}
    12881315
     1316
    12891317// IsUsingResources
    12901318/*! \brief Returns whether the object stores the meta data (also) in the
    12911319           file's resources.
     
    12981326    return (fWhere & B_USE_RESOURCES) != 0;
    12991327}
    13001328
     1329
    13011330// FBC
    13021331void BAppFileInfo::_ReservedAppFileInfo1() {}
    13031332void BAppFileInfo::_ReservedAppFileInfo2() {}
    13041333void BAppFileInfo::_ReservedAppFileInfo3() {}
    13051334
     1335
    13061336// =
    13071337/*! \brief Privatized assignment operator to prevent usage.
    13081338*/
     
    13121342    return *this;
    13131343}
    13141344
     1345
    13151346// copy constructor
    13161347/*! \brief Privatized copy constructor to prevent usage.
    13171348*/
     
    13191350{
    13201351}
    13211352
     1353
    13221354// GetMetaMime
    13231355/*! \brief Initializes a BMimeType to the file's signature.
    13241356
     
    13351367    - other error codes
    13361368*/
    13371369status_t
    1338 BAppFileInfo::GetMetaMime(BMimeType *meta) const
     1370BAppFileInfo::GetMetaMime(BMimeType* meta) const
    13391371{
    13401372    char signature[B_MIME_TYPE_LENGTH];
    13411373    status_t error = GetSignature(signature);
     
    13481380    return error;
    13491381}
    13501382
     1383
    13511384// _ReadData
    13521385/*! \brief Reads data from an attribute or resource.
    13531386
     
    13711404    - error code
    13721405*/
    13731406status_t
    1374 BAppFileInfo::_ReadData(const char *name, int32 id, type_code type,
    1375                         void *buffer, size_t bufferSize,
    1376                         size_t &bytesRead, void **allocatedBuffer) const
     1407BAppFileInfo::_ReadData(const char* name, int32 id, type_code type,
     1408                        void* buffer, size_t bufferSize,
     1409                        size_t &bytesRead, void** allocatedBuffer) const
    13771410{
    13781411    status_t error = B_OK;
    13791412   
     
    14431476            error = B_BAD_VALUE;
    14441477
    14451478        // load resource
    1446         const void *resourceData = NULL;
     1479        const void* resourceData = NULL;
    14471480        if (error == B_OK) {
    14481481            resourceData = fResources->LoadResource(type, name, &bytesRead);
    14491482            if (resourceData && sizeFound == bytesRead)
     
    14651498    return error;
    14661499}
    14671500
     1501
    14681502// _WriteData
    14691503/*! \brief Writes data to an attribute or resource.
    14701504
     
    14861520    - error code
    14871521*/
    14881522status_t
    1489 BAppFileInfo::_WriteData(const char *name, int32 id, type_code type,
    1490                          const void *buffer, size_t bufferSize, bool findID)
     1523BAppFileInfo::_WriteData(const char* name, int32 id, type_code type,
     1524                         const void* buffer, size_t bufferSize, bool findID)
    14911525{
    14921526    if (!IsUsingAttributes() && !IsUsingResources())
    14931527        return B_NO_INIT;
     
    15351569    - error code
    15361570*/
    15371571status_t
    1538 BAppFileInfo::_RemoveData(const char *name, type_code type)
     1572BAppFileInfo::_RemoveData(const char* name, type_code type)
    15391573{
    15401574    if (!IsUsingAttributes() && !IsUsingResources())
    15411575        return B_NO_INIT;
  • src/kits/storage/EntryList.cpp

     
    99
    1010#include <EntryList.h>
    1111
     12
    1213// constructor
    1314//! Creates a BEntryList.
    1415/*! Does nothing at this time.
     
    1718{
    1819}
    1920
     21
    2022// destructor
    2123//! Frees all resources associated with this BEntryList.
    2224/*! Does nothing at this time.
     
    2527{
    2628}
    2729
     30
    2831// GetNextEntry
    2932/*! \fn status_t BEntryList::GetNextEntry(BEntry *entry, bool traverse)
    3033    \brief Returns the BEntryList's next entry as a BEntry.
     
    104107void BEntryList::_ReservedEntryList6() {}
    105108void BEntryList::_ReservedEntryList7() {}
    106109void BEntryList::_ReservedEntryList8() {}
    107 
    108 
    109 
    110