namespace ngraph::file_util

Overview

namespace file_util {

// global functions

NGRAPH_API_DEPRECATED NGRAPH_API std::stringconst std::string& get_file_name();
NGRAPH_API_DEPRECATED NGRAPH_API std::stringconst std::string& get_file_ext();
NGRAPH_API_DEPRECATED NGRAPH_API std::stringconst std::string& get_directory();

NGRAPH_API_DEPRECATED NGRAPH_API std::stringconst std::string&const std::string& path_join(
    ,

    );

NGRAPH_API_DEPRECATED NGRAPH_API std::stringconst std::string&const std::string&const std::string& path_join(
    ,
    ,

    );

NGRAPH_API_DEPRECATED NGRAPH_API std::stringconst std::string&const std::string&const std::string&const std::string& path_join(
    ,
    ,
    ,

    );

NGRAPH_API_DEPRECATED NGRAPH_API voidconst std::string&std::function<void(const std::string&file, bool is_dir)>boolbool iterate_files(
    ,
    ,
    ,

    );

NGRAPH_API_DEPRECATED NGRAPH_API voidstd::string& convert_path_win_style();
NGRAPH_API_DEPRECATED NGRAPH_API std::stringconst std::wstring& wstring_to_string();
NGRAPH_API_DEPRECATED NGRAPH_API std::wstringconst char \* multi_byte_char_to_wstring();
NGRAPH_API_DEPRECATED NGRAPH_API std::stringconst std::string& sanitize_path();

} // namespace file_util

Detailed Documentation

Global Functions

NGRAPH_API_DEPRECATED NGRAPH_API std::stringconst std::string& get_file_name()

Returns the name with extension for a given path.

Parameters:

path

The path to the output file

NGRAPH_API_DEPRECATED NGRAPH_API std::stringconst std::string& get_file_ext()

Returns the file extension.

Parameters:

path

The path to the output file

NGRAPH_API_DEPRECATED NGRAPH_API std::stringconst std::string& get_directory()

Returns the directory portion of the given path.

Parameters:

path

The path to the output file

NGRAPH_API_DEPRECATED NGRAPH_API std::stringconst std::string&const std::string& path_join(
    ,

    )

Joins multiple paths into a single path.

Parameters:

s1

Left side of path

s2

Right side of path

NGRAPH_API_DEPRECATED NGRAPH_API voidconst std::string&std::function<void(const std::string&file, bool is_dir)>boolbool iterate_files(
    ,
    ,
    ,

    )

Iterate through files and optionally directories. Symbolic links are skipped.

Parameters:

path

The path to iterate over

func

A callback function called with each file or directory encountered

recurse

Optional parameter to enable recursing through path

NGRAPH_API_DEPRECATED NGRAPH_API voidstd::string& convert_path_win_style()

Change Linux-style path (‘/’) to Windows-style (‘')

Parameters:

path

The path to change file separator

NGRAPH_API_DEPRECATED NGRAPH_API std::stringconst std::wstring& wstring_to_string()

Conversion from wide character string to a single-byte chain.

Parameters:

wstr

A wide-char string

Returns:

A multi-byte string

NGRAPH_API_DEPRECATED NGRAPH_API std::wstringconst char \* multi_byte_char_to_wstring()

Conversion from single-byte chain to wide character string.

Parameters:

str

A null-terminated string

Returns:

A wide-char string

NGRAPH_API_DEPRECATED NGRAPH_API std::stringconst std::string& sanitize_path()

Remove path components which would allow traversing up a directory tree.

Parameters:

path

A path to file

Returns:

A sanitiazed path