Phobos Runtime Library

[color=violet](5.7更新)[/color]

注:看过 D_program (dmd1.0) D语言程序设计的人,这篇文章只需关注红色部分,以后与此书相同的部分将不再列出(网上很多)。感谢此书作者及书中提到的人员。
第一次试着翻译,如有错误请及时提出,谢谢!

Jump to: std std_windows std_linux std_c std_c_windows std_c_linux stdio

Phobos 是同 D 编译器捆绑的标准运行时库。另外,可以从wiki查看Phobos 。

哲学

Phobos 中的每个模块都尽量与下面的设计目标相符。他们只是目标而不是要求,因为 D 不是宗教,它是一种程序设计语言,并且我们认识到有时这些目标是相互矛盾并
且在某些情况下是很难达到的,这需要程序员参与来完成这些任务。

独立于机器和操作系统的接口
人们广泛认为应该尽量避免那些不必要的妨碍移植的问题。但是,这不应当被解读为要避免
访问操作系统的特殊的特征。

简单的操作应该简单
常用且简单的操作,如向文件中写入一个字节数组,应该能用简单的代码完成。目前为止,
我还没有看到那个类库简单且高效地实现了常用、基本的文件 I/O 操作。

类因该尽量互相独立
如果仅仅从文件中读取数据到字节数组中就需要一大片代码的话,是很让人泄气的。类之间
相互独立还意味着如果发现一个类有错误,可以在不重写库中其他类的前提下对类进行重
新设计。

不为 C 运行时库函数和 OS API 函数提供可有可无的封装
D 提供了对 C 运行时库函数和操作系统 API 函数的直接访问。那些可有可无的 D 封装只
会平添无尽的麻烦。

类实现应当采用 DBC
这将证明 DBC(契约式编程)的价值。这不只有助于对类进行调试,还会帮助类的用户正
确地使用类。类库中使用 DBC 会起到抛砖引玉的作用。

使用异常处理错误
参见 D 中的错误处理 。

--------------------------------------------------------------------------------

Imports 导入

Runtime library modules can be imported with the import statement. Each module falls into one of several packages:
可以用import语句导入运行时库模块,每个模块都属于一个或多个包:

std
These are the core modules.
这些是核心模块

std.windows
Modules specific to the Windows operating system.
专用于windows操作系统的模块

std.linux
Modules specific to the Linux operating system.
专用于Linux操作系统的模块

std.c
Modules that are simply interfaces to C functions. For example, interfaces to standard C library functions will be in std.c, such as std.c.stdio would be the interface to C's stdio.h.
该模块提供了对 C 函数的简单的接口。例如,对标准 C 库函数的接口在 std.c 中,如
std.c.stdio 是对 C 的 stdio.h 的接口。

std.c.windows
Modules corresponding to the C Windows API functions.
该模块提供了对 Windows API 函数的 C 语言接口。

std.c.linux
Modules corresponding to the C Linux API functions.
该模块提供了对 Linux API 函数的 C 语言接口。

etc
This is the root of a hierarchy of modules mirroring the std hierarchy. Modules in etc are not standard D modules. They are here because they are experimental, or for some other reason are not quite suitable for std, although they are still useful.
这里面是 std 层次结构的一个镜像。etc 中的模块不是标准的 D 模块。之所以单独建立一个
目录,是因为这些模块是实验性的,或者是因为它们不适合于放到 std 中,尽管它们很有
用。

--------------------------------------------------------------------------------

std: Core library modules
核心库模块

std.base64
Encode/decode base64 format.
使用base64格式的解码/译码函数

[color=violet]std.bind
Bind function arguments.
绑定函数自变量 (大概是对c++库 boost::bind 的包装,不太懂,以后再说。5/7)

std.bitarray
Arrays of bits.
位数组模块

std.bitmanip
Bit-level manipulation facilities.
关于位级别的操作(5/7)

std.boxer
Box/unbox types.
类型转换模块[/color]

std.compiler
Information about the D compiler implementation.
有关 D 编译器实现的信息。

std.conv
Conversion of strings to integers.
将字符串转换为正数的函数

std.ctype
Simple character classification
简单的字符分类

std.date
Date and time functions. Support locales.
日期和时间函数。支持 地区 。

std.file
Basic file operations like read, write, append.
基本的文件操作,例如:读、写和追加

std.format
Formatted conversions of values to strings.
将值[color=violet](数值)[/color]格式化为字符串

std.gc
Control the garbage collector.
控制垃圾收集程序

std.intrinsic
Compiler built in intrinsic functions
编译器内建的内情函数

std.math
Include all the usual math functions like sin, cos, atan, etc.
包括所有常用的数学函数,例如:sin、cos、atan 等。

std.md5
Compute MD5 digests.
计算 MD5 摘要。

std.mmfile
Memory mapped files.
内存映射文件

object
The root class of the inheritance hierarchy
继承体系中的根类

[color=violet]std.openrj
Basic database.
数据库的基础模块[/color]

std.outbuffer
Assemble data into an array of bytes
装配数据到字节数组

std.path
Manipulate file names, path names, etc.
处理文件名、路径名等

[color=violet]std.perf
Platform-independent performance measurement and timing classes
平台独立的性能测试和计时类 (5/7)[/color]

std.process
Create/destroy threads.
创建/销毁线程

std.random
Random number generation.
生成随机数

[color=violet]std.recls
Recursively search file system and (currently Windows only) FTP sites.
递归搜索文件系统(当前仅windows)和FTP站点[/color]

std.regexp
The usual regular expression functions.
常用的正则表达式函数

std.socket
Sockets.
套接字

std.socketstream
Stream for a blocking, connected Socket.
阻塞、已连接 Socket 的流

std.stdint
Integral types for various purposes.
用于各种用途的整数类型

std.stdio
Standard I/O.
标准 I/O.

[color=violet]std.cstream
Stream I/O.
流I/O(和下一个的区别?)
[/color]刚查了一下std.cstream一章,它是std.c.stdio (or std.stdio) 和 std.stream 的桥接模块(5.4更新)

std.stream
Stream I/O.
流I/O

std.string
Basic string operations not covered by array ops.
数组不支持的一些基本的字符串操作

std.system
Inquire about the CPU, operating system.
查询 CPU、操作系统的信息

std.thread
One per thread. Operations to do on a thread.
对线程的操作

std.uri
Encode and decode Uniform Resource Identifiers (URIs).
URIs(统一资源标识符)的解码、译码

std.utf
Encode and decode utf character encodings.
utf编码的解码、译码

std.zip
Read/write zip archives.
读/写 zip(压缩)文件

std.zlib
Compression / Decompression of data.
数据压缩、解压缩

--------------------------------------------------------------------------------

[color=violet]std.windows: Modules specific to the Windows operating system
windows操作系统的特殊模块
std.windows.syserror
Convert Windows error codes to strings.
将windows错误代码转换为字符串
--------------------------------------------------------------------------------

std.linux: Modules specific to the Linux operating system
Linux操作系统的特殊模块
[/color]

--------------------------------------------------------------------------------

std.c: Interface to C functions
到 C 函数的接口

std.c.stdio
Interface to C stdio functions like printf().
到 C stdio 函数如 printf() 的接口。

--------------------------------------------------------------------------------

std.c.windows: Interface to C Windows functions
到 C Windows 函数的接口

std.c.windows.windows
Interface to Windows APIs
到 Windows API 的接口

--------------------------------------------------------------------------------

std.c.linux: Interface to C Linux functions
到 C Linux 函数的接口

std.c.linux.linux
Interface to Linux APIs
到 Linux API 的接口

--------------------------------------------------------------------------------

std.c.stdio
int printf(char* format, ...)
C printf() function.
C printf() 函数
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: phobos勒索病毒是一种非常破坏性的计算机病毒,它会对用户的计算机进行加密,并要求用户支付赎金才能够获取解密密钥。这种病毒的出现给用户的生活和工作带来了很大的不便和麻烦,因此,很多专业的安全公司也在积极研发解密工具来帮助用户解决这个问题。 phobos勒索病毒解密工具是一种能够解密被该病毒加密的文件的软件程序。它可以在不向攻击者支付赎金的情况下,还原用户被加密的数据。在使用这种工具的时候,用户需要按照工具的使用说明进行操作,具体步骤主要包括下载并安装解密工具,选择被加密的文件,并且开始进行解密操作。在解密的过程中,用户需要根据工具提供的提示,输入密钥以完成解密。 但是需要注意的是,phobos勒索病毒解密工具可能不会完全解决用户所遇到的问题。因为病毒本身是会不断更新改进的,所以解密工具也需要不断跟进和更新才能够适应最新的病毒版本。因此,用户在使用解密工具进行解密的过程中,还需要注意备份和防范措施,并且在遇到问题时及时求助专业的技术人员,以尽可能保护自己的数据安全。 ### 回答2: Phobos勒索病毒是一种非常恶性的计算机病毒,它会通过加密系统文件和文档等方式,使得用户无法访问自己的计算机数据。这种病毒常常要求受害者支付赎金,以获取解密文件的密钥,否则就永远无法恢复自己的数据。 为了解决这个问题,专业的技术人员和安全公司开发了Phobos勒索病毒解密工具。这种工具能够通过解开Phobos勒索病毒加密的算法,找到并还原其中数据的密钥,使得受害者可以重新访问自己的文件和目录。 然而,使用Phobos勒索病毒解密工具并不是一件容易的事情。首先,这种工具只能用于特定版本的Phobos勒索病毒,对于其他版本的病毒可能无效。其次,解密工具的使用需要专业的技术人员和丰富的经验,否则可能会导致数据损坏或丢失。而且,解密工具可能需要付费购买,这增加了受害者的经济压力。 因此,为了避免被这种恶意病毒攻击,用户应该尽量提升自己的安全意识,加强计算机和文件的保护措施,定期备份重要数据。如果不幸感染了Phobos勒索病毒,建议第一时间联系专业的安全团队,寻求专业的帮助和建议。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值