SmartFTP FTP Library
IFTPParserD Interface Reference

Interface for parsing raw FTP directory listings. More...

import "sfFTPLib.idl";

Public Member Functions

HRESULT Initialize ([in] ParserFormat format)
 Configures the parser for a specific directory listing format.
HRESULT ParseLine ([in] BSTR line, [out, retval] IFTPItem **item)
 Parses a single line of directory listing text into an item object.

Detailed Description

Interface for parsing raw FTP directory listings.

This interface is responsible for interpreting the raw text lines returned by an FTP/SFTP server (e.g., in response to a LIST command) and converting them into structured IFTPItem objects.

Member Function Documentation

◆ Initialize()

HRESULT IFTPParserD::Initialize ( [in] ParserFormat format)

Configures the parser for a specific directory listing format.

This method must be called before ParseLine to ensure the parser correctly interprets the incoming text.

Parameters
[in]formatA value from the ParserFormat enumeration indicating the expected server output style.

◆ ParseLine()

HRESULT IFTPParserD::ParseLine ( [in] BSTR line,
[out, retval] IFTPItem ** item )

Parses a single line of directory listing text into an item object.

This method analyzes a raw text string, extracts metadata (filename, size, timestamp, permissions), and returns a populated IFTPItem object.

Example:

  • Input: "-rw-r--r-- 1 user group 1234 Feb 11 19:30 index.html"
  • Output: An IFTPItem where .Name="index.html", .Size=1234, etc.

Skipped Lines: Some lines in a listing (like "Total 42" headers or empty lines) do not represent files. In these cases, the method may returns E_FAIL.

Parameters
[in]lineThe raw text line to parse.
[out]itemAddress of a pointer variable that receives the new IFTPItem object.

The documentation for this interface was generated from the following file: