Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Internet Protocols Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

RWDirEntry

Module:  Internet Protocols Module   Package:  Internet Basics


Does not inherit

Local Index

Members

Non-Members

Header File

#include <rw/internet/RWDirEntry.h>

Description

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

FileType Owner Group Size Date Time Name Link

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

 

If the owner and/or group field is missing, the parsing mechanism provides empty defaults. Data type 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, the object is set to the invalid state and an error text message is saved. This message is available through the getError() method. If the directory entry parse fails, a copy of the original input string is available through the data method.

Example

Program Output

Public Enum

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

Public Constructors

RWDirEntry();
RWDirEntry(const RWCString& text);

Public Member Functions

RWCString
getData() const;
RWCString
getError() const;
RWCString
getLink() const;
RWCString
getName() const;
int
getSize() const;
RWTime
getTime() const;
entryType
getType() const;
bool
isValid() const;

Global Operator

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

NOTE -- This class does not have an extraction (>>) operator.


Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.