LibraryInterface Class Reference

#include <vm.h>

Inheritance diagram for LibraryInterface:

详细描述

A helper interface with convenient functions, which are needed when dealing with other interfaces in this framework

静态公共成员函数

static MAXON_METHOD Bool   ConsoleIsAvailable ()
static MAXON_METHOD Result < String GetFileContent (const Url &filepath)
static MAXON_METHOD Result < void >  SetFileContent (const Url &filepath, const String &str, Bool append)

私有成员函数

  MAXON_INTERFACE ( LibraryInterface , MAXON_REFERENCE_NORMAL , "net.maxon.python.interface.library")

成员函数文档编制

◆  MAXON_INTERFACE()

MAXON_INTERFACE ( LibraryInterface   ,
MAXON_REFERENCE_NORMAL   ,
"net.maxon.python.interface.library"   
)
private

◆  ConsoleIsAvailable()

static MAXON_METHOD Bool ConsoleIsAvailable ( )
static

Checks if a console is attached to the current process

返回
True if a console is attached, otherwise False.

◆  GetFileContent()

static MAXON_METHOD Result < String > GetFileContent ( const Url filepath )
static

Returns the content of a given file in a string. The file is expected to be encoded in UTF-8.

参数
[in] filepath Path of the file.
返回
Content of the file in a string, or returns an error if reading failed.

◆  SetFileContent()

static MAXON_METHOD Result <void> SetFileContent ( const Url filepath ,
const String str ,
Bool   append  
)
static

Writes the content of a string to a given file. The content will be encoded in UTF-8.

参数
[in] filepath Path of the file.
[in] str Content to write.
[in] append True to append the content to the file, or False to overwrite the entire content with the new string.
返回
Returns OK if the operation succeeded.