STTNet 0.7.0
Loading...
Searching...
No Matches
stt::data::NetworkOrderUtil Class Reference

负责大小端字节序转换 More...

#include <sttnet.h>

Static Public Member Functions

static unsigned long & htonl_ntohl_64 (unsigned long &data)
 将 64 位无符号整数的字节序反转(大端 <-> 小端)。
 

Detailed Description

负责大小端字节序转换

Member Function Documentation

◆ htonl_ntohl_64()

static unsigned long & stt::data::NetworkOrderUtil::htonl_ntohl_64 ( unsigned long & data)
static

将 64 位无符号整数的字节序反转(大端 <-> 小端)。

该函数模拟 htonl/ntohl 的 64 位版本,即按字节交换实现高低位互换。 原地修改参数并返回引用。

Parameters
data输入的 64 位无符号整数,按字节反转后返回。
Returns
反转后的 data 引用。
Note
该实现不依赖平台库函数,适用于不确定机器端序的场景。

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