Boost logo

Boost :

From: Jan Langer (jan_at_[hidden])
Date: 2002-03-03 14:14:32

On Sun, 3 Mar 2002, Dietmar Kuehl wrote:
>> why do you want to mix the identification of the file with the storage
>> and access of its attributes. IMO the task of the property-map.
>Don't confuse property maps with maps: A property map is basically a
>facility which provides access to some properties of some entity. This
>will most often just access members of the entity provides as key. It
>may as well make a lookup as is done in 'std::map' but this is more an
>exception than the rule.

ok, i mixed this up. i meant the attribute cache.

>For each file attribute, a unique property map is used. For the file
>properties supported directly be the library, these property maps just
>access a member of the otherwise opaque tpye. Internally, this stores
>the result obtained from walking a directory (eg. with POSIX a 'DIR*')
>and a cache for the file attributes (eg. with POSIX a 'struct stat').
>The file name is just one of these attributes. The object of the opaque
>type is the identification, not the file name.

i would use three types. one for saving the directory walking status
(DIR and dirent), one as an identification object and one as the
attribute cache. and i think the first type which saves the walking
status should be the iterator itself. and it should return only that
part of its data which is useful for others (on posix only the filename)
and which identifies the file. these data can then be used to construct
an attribute cache.

>>>The opaque type would be useful for users only as a key to corresponding
>>>property maps accessing the various file attributes.
>> yes, thats exactly what string should do in a posix impl..
>No. That would be unnecessary ineffecient it would still be necessary
>to store the directory walking status somewhere.

i don't understand that. the identification object (opaque type) is part
of the dir. walking status.

as i see it i do mainly agree with you. the only difference is that you
want the mix the identification object with the attribute cache. and i
want to have it separated. and my identification object should be
either string or a thin wrapper for it (at least for posix).

your approach seems to mean that a directory iterator points to an
attribute cache.

jan langer ... jan_at_[hidden]
"pi ist genau drei"

Boost list run by bdawes at, gregod at, cpdaniel at, john at