Object 内置对象

对象 object

基础对象,所有对象均继承于此

继承关系

%0 object object toString() toJSON() Buffer Buffer object->Buffer Cipher Cipher object->Cipher DbConnection DbConnection object->DbConnection Digest Digest object->Digest EventEmitter EventEmitter object->EventEmitter EventInfo EventInfo object->EventInfo Fiber Fiber object->Fiber Handler Handler object->Handler HeapGraphEdge HeapGraphEdge object->HeapGraphEdge HeapGraphNode HeapGraphNode object->HeapGraphNode HeapSnapshot HeapSnapshot object->HeapSnapshot HttpClient HttpClient object->HttpClient HttpCollection HttpCollection object->HttpCollection HttpCookie HttpCookie object->HttpCookie HttpUploadData HttpUploadData object->HttpUploadData Image Image object->Image Int64 Int64 object->Int64 LevelDB LevelDB object->LevelDB Lock Lock object->Lock LruCache LruCache object->LruCache Message Message object->Message MongoCollection MongoCollection object->MongoCollection MongoCursor MongoCursor object->MongoCursor MongoDB MongoDB object->MongoDB MongoID MongoID object->MongoID PKey PKey object->PKey Redis Redis object->Redis RedisHash RedisHash object->RedisHash RedisList RedisList object->RedisList RedisSet RedisSet object->RedisSet RedisSortedSet RedisSortedSet object->RedisSortedSet SandBox SandBox object->SandBox Smtp Smtp object->Smtp Stat Stat object->Stat Stats Stats object->Stats Stream Stream object->Stream StringDecoder StringDecoder object->StringDecoder TcpServer TcpServer object->TcpServer Timer Timer object->Timer UrlObject UrlObject object->UrlObject X509Cert X509Cert object->X509Cert X509Crl X509Crl object->X509Crl X509Req X509Req object->X509Req XmlAttr XmlAttr object->XmlAttr XmlNamedNodeMap XmlNamedNodeMap object->XmlNamedNodeMap XmlNode XmlNode object->XmlNode XmlNodeList XmlNodeList object->XmlNodeList ZipFile ZipFile object->ZipFile ZmqSocket ZmqSocket object->ZmqSocket MSSQL MSSQL DbConnection->MSSQL MySQL MySQL DbConnection->MySQL SQLite SQLite DbConnection->SQLite Service Service EventEmitter->Service WebSocket WebSocket EventEmitter->WebSocket WebView WebView EventEmitter->WebView Worker Worker EventEmitter->Worker Chain Chain Handler->Chain HandlerEx HandlerEx Handler->HandlerEx Routing Routing Handler->Routing SslHandler SslHandler Handler->SslHandler HttpHandler HttpHandler HandlerEx->HttpHandler Condition Condition Lock->Condition Event Event Lock->Event Semaphore Semaphore Lock->Semaphore HttpMessage HttpMessage Message->HttpMessage WebSocketMessage WebSocketMessage Message->WebSocketMessage HttpRequest HttpRequest HttpMessage->HttpRequest HttpResponse HttpResponse HttpMessage->HttpResponse BufferedStream BufferedStream Stream->BufferedStream SeekableStream SeekableStream Stream->SeekableStream Socket Socket Stream->Socket SslSocket SslSocket Stream->SslSocket SubProcess SubProcess BufferedStream->SubProcess File File SeekableStream->File MemoryStream MemoryStream SeekableStream->MemoryStream HttpServer HttpServer TcpServer->HttpServer SslServer SslServer TcpServer->SslServer HttpsServer HttpsServer HttpServer->HttpsServer XmlCharacterData XmlCharacterData XmlNode->XmlCharacterData XmlDocument XmlDocument XmlNode->XmlDocument XmlDocumentType XmlDocumentType XmlNode->XmlDocumentType XmlElement XmlElement XmlNode->XmlElement XmlProcessingInstruction XmlProcessingInstruction XmlNode->XmlProcessingInstruction XmlComment XmlComment XmlCharacterData->XmlComment XmlText XmlText XmlCharacterData->XmlText XmlCDATASection XmlCDATASection XmlText->XmlCDATASection

成员函数

toString

返回对象的字符串表示,一般返回 "[Native Object]",对象可以根据自己的特性重新实现

1
String object.toString();

返回结果:

  • String, 返回对象的字符串表示

toJSON

返回对象的 JSON 格式表示,一般返回对象定义的可读属性集合

1
Value object.toJSON(String key = "");

调用参数:

  • key: String, 未使用

返回结果:

  • Value, 返回包含可 JSON 序列化的值