* Applied our coding guidelines

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26883 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Salvatore Benedetto 2008-08-09 08:14:40 +00:00
parent d9409b5cda
commit 90b73f5f3f
3 changed files with 79 additions and 103 deletions

View File

@ -53,17 +53,16 @@ private:
void _Rewind();
void _WalkContinuationChain(Descriptor *descriptor);
Accessor fAccessor;
CachedBlock fAdditionalDescriptors;
off_t fBlockIndex;
int32 fDescriptorIndex;
int32 fDescriptorNumber;
Icb *fIcb;
Descriptor *fIcbDescriptors;
int32 fIcbDescriptorsSize;
bool fReadFromIcb;
Volume *fVolume;
Accessor fAccessor;
int32 fDescriptorIndex;
int32 fDescriptorNumber;
off_t fBlockIndex;
};
@ -74,10 +73,10 @@ AllocationDescriptorList<Accessor>::AllocationDescriptorList(Icb *icb,
fAccessor(accessor),
fAdditionalDescriptors(icb->GetVolume()),
fBlockIndex(0),
fIcb(icb),
fIcbDescriptors((Descriptor *)icb->AllocationDescriptors()),
fDescriptorIndex(0),
fDescriptorNumber(0),
fIcb(icb),
fIcbDescriptors((Descriptor *)icb->AllocationDescriptors()),
fIcbDescriptorsSize(icb->AllocationDescriptorsSize()),
fReadFromIcb(true),
fVolume(icb->GetVolume())

View File

@ -1,24 +1,19 @@
//----------------------------------------------------------------------
// This software is part of the Haiku distribution and is covered
// by the MIT license.
//
// Copyright (c) 2003 Tyler Dauwalder, tyler@dauwalder.net
//---------------------------------------------------------------------
/*! \file DirectoryIterator.cpp
/*
* Copyright 2003, Tyler Dauwalder, tyler@dauwalder.net.
* Distributed under the terms of the MIT License.
*/
/*! \file DirectoryIterator.cpp */
#include "DirectoryIterator.h"
#include "Icb.h"
#include "UdfString.h"
#include "Utils.h"
#include <dirent.h>
#include <stdio.h>
#include "Icb.h"
#include "UdfString.h"
#include "Utils.h"
using namespace Udf;
status_t
DirectoryIterator::GetNextEntry(char *name, uint32 *length, ino_t *id)
@ -32,7 +27,6 @@ DirectoryIterator::GetNextEntry(char *name, uint32 *length, ino_t *id)
PRINT(("fPosition: %Ld\n", fPosition));
PRINT(("Parent()->Length(): %Ld\n", Parent()->Length()));
status_t error = B_OK;
if (fAtBeginning) {
sprintf(name, ".");
@ -55,7 +49,8 @@ DirectoryIterator::GetNextEntry(char *name, uint32 *length, ino_t *id)
// then, based on the information therein, read in the variable
// length tail portion as well.
error = Parent()->Read(offset, entry, &entryLength, &block);
if (!error && entryLength >= sizeof(file_id_descriptor) && entry->tag().init_check(block) == B_OK) {
if (!error && entryLength >= sizeof(file_id_descriptor)
&& entry->tag().init_check(block) == B_OK) {
PDUMP(entry);
offset += entry->total_length();
@ -63,7 +58,7 @@ DirectoryIterator::GetNextEntry(char *name, uint32 *length, ino_t *id)
sprintf(name, "..");
*length = 3;
} else {
String string(entry->id(), entry->id_length());
UdfString string(entry->id(), entry->id_length());
PRINT(("id == `%s'\n", string.Utf8()));
DUMP(entry->icb());
sprintf(name, "%s", string.Utf8());
@ -79,27 +74,23 @@ DirectoryIterator::GetNextEntry(char *name, uint32 *length, ino_t *id)
RETURN(error);
}
/* \brief Rewinds the iterator to point to the first
entry in the directory.
*/
/* \brief Rewinds the iterator to point to the first entry in the directory. */
void
DirectoryIterator::Rewind()
{
fPosition = 0;
fAtBeginning = true;
fPosition = 0;
}
// #pragma - Private methods
DirectoryIterator::DirectoryIterator(Icb *parent)
: fParent(parent)
, fPosition(0)
, fAtBeginning(true)
:
fAtBeginning(true),
fParent(parent),
fPosition(0)
{
}
void
DirectoryIterator::Invalidate()
{
fParent = NULL;
}

View File

@ -1,54 +1,40 @@
//----------------------------------------------------------------------
// This software is part of the Haiku distribution and is covered
// by the MIT license.
//
// Copyright (c) 2003 Tyler Dauwalder, tyler@dauwalder.net
//---------------------------------------------------------------------
/*
* Copyright 2003, Tyler Dauwalder, tyler@dauwalder.net.
* Distributed under the terms of the MIT License.
*/
#ifndef _UDF_DIRECTORY_ITERATOR_H
#define _UDF_DIRECTORY_ITERATOR_H
/*! \file DirectoryIterator.h
*/
/*! \file DirectoryIterator.h */
#ifndef _IMPEXP_KERNEL
# define _IMPEXP_KERNEL
#endif
#ifdef COMPILE_FOR_R5
extern "C" {
#endif
#include "fsproto.h"
#ifdef COMPILE_FOR_R5
}
#endif
#include "kernel_cpp.h"
#include "UdfDebug.h"
namespace Udf {
#include <util/kernel_cpp.h>
class Icb;
class DirectoryIterator {
public:
status_t GetNextEntry(char *name, uint32 *length, ino_t *id);
void Rewind();
status_t GetNextEntry(char *name, uint32 *length,
ino_t *id);
Icb *Parent() { return fParent; }
const Icb *Parent() const { return fParent; }
void Rewind();
private:
friend class Icb;
DirectoryIterator(); // unimplemented
DirectoryIterator(Icb *parent); // called by Icb::GetDirectoryIterator()
void Invalidate(); // called by Icb::~Icb()
/* The following is called by Icb::GetDirectoryIterator() */
DirectoryIterator(Icb *parent);
/* The following is called by Icb::~Icb() */
void _Invalidate() { fParent = NULL; }
bool fAtBeginning;
Icb *fParent;
off_t fPosition;
bool fAtBeginning;
};
}; // namespace Udf
#endif // _UDF_DIRECTORY_ITERATOR_H