Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

RWIDirEntry



Module

Networking Tools: Thread-hot Internet Classes (int library)

Data Type and Member Function Indexes
(exclusive of constructors and destructors)

Data Types

Member Functions

Synopsis

#include <rw/toolpro/dent.h>
RWIDirEntry entry("drwxr-xr-x fred staff 512 Apr 24 16:14
                   pub");

Required Libraries

thr, net, int, tls (and possibly std)

Description

The RWIDirEntry is a convenience class that encapsulates parsing and component storage of directory entries typical of those returned from the FTP LIST command. Typically, the directory entry format is some variation of the UNIX ls long format. The RWIDirEntry class is robust in its ability to make sense of the data presented to it. RWIDirEntry expects text similar to the following:

 
FileTypeOwnerGroupSizeDateTimeNameLink
drwxr-xr-x 3
fred
staff
512
Apr 24
16:14
pub
lrwxr-xr-x 1
fred
staff
512
Jan 10
1990
data
->/data2
-rw-rw-rw- 1
fred
staff
1024
Apr 24
12:23
stuff

Often the owner and/or group field is missing. If so, the parsing mechanism provides empty defaults. Datatype checks are performed on the fields (for example, Size must be an integer and Time must be in the form XX:XX). If any field fails its format test, then the object is set to the invalid state and an error text message is saved. This message is available through the error method. If the directory entry parse fails, a copy of the original input string is available through the data method.

Example

Program Output

Public Enums

enum entryType { ftype_directory, ftype_link, ftype_file,
                 ftype_unknown };

Public Constructors

RWIDirEntry();
RWIDirEntry(const RWCString& text);

Public Member Functions

RWCString
data() const;
RWCString
error() const;
RWBoolean
isValid() const;
RWCString
link() const;
RWCString
name() const;
int
size() const;
RWTime
time() const;
entryType
type() const;

Global Operators

ostream&
operator<<(ostream& strm, const RWIDirEntry& de);


Previous fileTop of DocumentContentsIndexNext file

©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.