mFrame
載入中...
搜尋中...
無符合項目
ufm::lang::Data 類別 參考文件

資料處理類別 更多...

#include <Data.h>

類別ufm::lang::Data的繼承圖:
ufm::lang::Pointer ufm::lang::Object ufm::lang::Interface ufm::io::SimpleReader ufm::io::SimpleWriter ufm::lang::Memory ufm::lang::Strings ufm::util::PArray

公開方法(Public Methods)

 Data (void)
 建立新的 Data 物件
 
 Data (const char *pointer)
 根據字元指標建立 Data 物件
 
 Data (const void *pointer, int length)
 使用常數 void 指標及長度建立 Data 物件
 
 Data (void *pointer, int length)
 使用可修改 void 指標及長度建立 Data 物件
 
 Data (const Data &other)
 複製建構子,根據現有 Data 物件建立新物件
 
Dataoperator= (const Data &other)=default
 賦值運算子,將另一個 Data 物件的內容複製到當前物件
 
virtual int copy (const void *source, int shift, int start, int length) override
 將來源資料複製到 Data 物件中
 
bool isReadOnly (void) const
 檢查資料是否唯讀
 
int length (void) const
 取得資料有效長度
 
uint32 lengthUnsigned (void) const
 取得資料無符號長度
 
int wipe (void)
 以預設值 0x00 擦除所有資料
 
int wipe (uint8 value)
 以指定值擦除所有資料
 
int wipe (uint8 value, int length)
 從起始處以指定長度使用指定值擦除資料
 
int popArray (int start, int length)
 從指定起始位置取出陣列資料(不儲存結果)
 
int popArray (void *source, int start, int length)
 從指定起始位置取出陣列資料並儲存至指定來源
 
int insertArray (const void *source, int start, int length)
 將來源陣列資料插入到 Data 物件中
 
bool inRange (void *address) const
 檢查指定位址是否落在資料範圍內
 
int wipe (uint8 value, int start, int length)
 從指定起始位置以指定長度擦除資料
 
ufm::lang::Data subData (int beginIndex, int length) const
 取得子資料區段
 
int insertArray (const void *source, int shift, int start, int length)
 將來源陣列資料依指定位移複製至 Data 物件中
 
int popArray (void *source, int shift, int start, int length)
 Data 物件中依指定位移取出陣列資料
 
virtual int hashdata (void) const
 計算資料雜湊值
 
int copy (const void *source, int length)
 複製來源資料至內部資料區塊,使用預設偏移參數
 
int copy (const void *source, int offset, int length)
 複製來源資料至內部資料區塊,可指定目標位址偏移
 
- 公開方法(Public Methods) 繼承自 ufm::lang::Pointer
 Pointer (void)
 儲存指標的內部成員變數
 
 Pointer (const void *pointer)
 建立一個 Pointer 物件,並以 const void* 初始化內部指標
 
 Pointer (void *pointer)
 建立一個 Pointer 物件,並以 void* 初始化內部指標
 
 Pointer (uint32 pointer)
 建立一個 Pointer 物件,並以 32 位元整數表示的位址初始化
 
 Pointer (const Pointer &other)
 複製建構子,從另一個 Pointer 物件複製內部位址
 
 operator void * (void)
 隱式轉換為 void*,可直接取得內部指標
 
 operator const char * (void)
 隱式轉換為 const char*,適用於字串存取
 
bool operator== (const void *pointer)
 比較內部指標與外部指標是否相同
 
bool operator== (const Pointer &pointer)
 比較兩個 Pointer 物件的內部指標是否相同
 
template<typename E >
 operator E* (void)
 模板運算子,將內部指標轉換為指定型態的指標(非 const 版本)
 
template<typename E >
 operator E* (void) const
 模板運算子,將內部指標轉換為指定型態的指標(const 版本)
 
Pointeroperator= (const Pointer &other)=default
 賦值運算子,將另一個 Pointer 物件的內部指標複製到當前物件
 
int copyTo (void *destination, int length) const
 複製內部資料至目標記憶體區塊
 
int copyTo (void *destination, int start, int length) const
 複製內部資料至目標記憶體區塊,可指定來源起始位置
 
bool compairStrings (const char *str) const
 比較內部資料與傳入字串是否相同(從起始位置開始比較)
 
bool compairStrings (const char *str, int start) const
 比較內部資料與傳入字串是否相同,可指定來源資料起始位置
 
bool compair (const void *source, int length) const
 比較內部資料與來源資料是否相等(從起始位置開始比較)
 
bool compair (const void *source, int start, int length) const
 比較內部資料與來源資料是否相等,可指定來源資料的起始偏移
 
int indexOf (char ch, int start, int limit) const
 在內部資料中查找指定字元 ch,回傳該字元的偏移位置
 
int indexOfStrings (const char *str, int limit) const
 在內部資料中查找指定字串,回傳該字串的偏移位置(使用預設起始位置)
 
int indexOfStrings (const char *str, int start, int limit) const
 在內部資料中查找指定字串,回傳該字串的偏移位置
 
int copy (const void *source, int length)
 複製來源資料至內部資料區塊,使用預設偏移參數
 
int copy (const void *source, int offset, int length)
 複製來源資料至內部資料區塊,可指定目標位址偏移
 
char getByte (int shift) const
 取得指定偏移處的 byte 值
 
int getInteger (int shift) const
 取得指定偏移處的整數值
 
short getShort (int shift) const
 取得指定偏移處的 short 值
 
Pointer getPointer (int offset) const
 以指定偏移建立新的 Pointer 物件
 
uint32 getAddress (void) const
 取得內部記憶體位址的整數表示
 
bool isAlignment32Bit (void)
 檢查內部位址是否 32 位元對齊
 
bool isAlignment64Bit (void)
 檢查內部位址是否 64 位元對齊
 
bool isNull (void) const
 檢查內部指標是否為空
 
template<typename E = void*>
E * pointer (void) const
 模板方法,取得內部指標並轉換為指定型態(不指定偏移)
 
template<typename E = void*>
E * pointer (int offset) const
 模板方法,取得內部指標並轉換為指定型態(指定偏移)
 
template<typename E = void*>
E * pointer (uint32 offset) const
 模板方法,取得內部指標並轉換為指定型態(指定偏移,使用 uint32 參數)
 
virtual int copyTo (void *destination, int offset, int destinationOffset, int length) const
 將內部資料複製到目標記憶體區塊,可指定來源與目標的起始偏移
 
virtual bool compair (const void *source, int offset, int sourceOffset, int length) const
 比較內部資料與來源資料是否相等,可指定各自的起始偏移與比較長度
 
virtual int indexOfData (const void *destination, int destinationLen, int start=0, int limit=0) const
 尋找指定 pattern 是否存在於內部資料中,並返回第一個符合條件的偏移量
 
virtual void move (int head, int offset, int length)
 將來源位置的資料以中間緩衝區方式移動至新的位置
 
- 公開方法(Public Methods) 繼承自 ufm::lang::Object
void * operator new (size_t n)
 使用運算子 new 分配記憶體
 
void * operator new (size_t n, void *p)
 在指定記憶體上調用運算子 new
 
virtual ufm::lang::ObjectgetObject (void) override
 取得對應的 Object 物件
 
void delay (int milliseconds) const
 延遲指定的毫秒數進行執行緒等待
 
bool equals (Object *object) const
 判斷與另一物件是否為相同參照(指標型態比較)
 
bool equals (Object &object) const
 判斷與另一物件是否為相同參照(參照型態比較)
 
void wait (void) const
 使當前線程等待直到被通知
 
bool wait (int timeout) const
 等待通知或超時
 
bool yield (void) const
 讓執行緒讓渡控制權給同優先權的下一個執行緒
 
int lock (void) const
 核心鎖定,鎖定期間禁止線程切換
 
int unlock (void) const
 核心解鎖
 
ufm::sys::ThreadcurrentThread (void) const
 取得當前執行緒指標
 
virtual int hashcode (void) const
 返回對象的哈希碼值。支持這種方法是為了散列表,如HashMap提供的那樣。
 
- 公開方法(Public Methods) 繼承自 ufm::lang::Interface
virtual ~Interface (void)=default
 虛擬析構函式
 

靜態公開方法(Static Public Methods)

static void wipe (void *pointer, uint8 value, int length)
 使用指定值擦除記憶體區塊
 
static void wipe (void *pointer, int length)
 根據指定長度擦除記憶體區塊
 

詳細描述

資料處理類別

此類別繼承自 Pointer,提供:

  • 記憶體讀寫操作
  • 資料複製
  • 清除
  • 子區段切割
  • 唯讀保護
1.0.0

建構子與解構子說明文件

◆ Data() [1/4]

ufm::lang::Data::Data ( const char * pointer)
explicit

根據字元指標建立 Data 物件

參數
pointer字元指標

◆ Data() [2/4]

ufm::lang::Data::Data ( const void * pointer,
int length )

使用常數 void 指標及長度建立 Data 物件

參數
pointer資料來源指標
length資料長度

◆ Data() [3/4]

ufm::lang::Data::Data ( void * pointer,
int length )

使用可修改 void 指標及長度建立 Data 物件

參數
pointer資料來源指標
length資料長度

◆ Data() [4/4]

ufm::lang::Data::Data ( const Data & other)

複製建構子,根據現有 Data 物件建立新物件

參數
otherData 物件

函式成員說明文件

◆ copy() [1/3]

int ufm::lang::Pointer::copy ( const void * source,
int length )
inline

複製來源資料至內部資料區塊,使用預設偏移參數

參數
source來源資料位址
length複製的 byte 數
傳回值
int 實際複製的 byte 數

◆ copy() [2/3]

int ufm::lang::Pointer::copy ( const void * source,
int offset,
int length )
inline

複製來源資料至內部資料區塊,可指定目標位址偏移

參數
source來源資料位址
offset內部資料儲存起始偏移
length複製的 byte 數
傳回值
int 實際複製的 byte 數

◆ copy() [3/3]

virtual int ufm::lang::Data::copy ( const void * source,
int shift,
int start,
int length )
overridevirtual

將來源資料複製到 Data 物件中

參數
source資料來源指標
shift位移量
start起始位置
length複製長度
傳回值
int 操作結果

依據ufm::lang::Pointer重新實作.

◆ hashdata()

virtual int ufm::lang::Data::hashdata ( void ) const
virtual

計算資料雜湊值

傳回值
int 雜湊值

ufm::lang::Strings重新實作.

◆ inRange()

bool ufm::lang::Data::inRange ( void * address) const

檢查指定位址是否落在資料範圍內

參數
address檢查位址
傳回值
true 在範圍內
false 不在範圍內

◆ insertArray() [1/2]

int ufm::lang::Data::insertArray ( const void * source,
int shift,
int start,
int length )

將來源陣列資料依指定位移複製至 Data 物件中

參數
source資料來源指標
shift位移量
start起始位置
length複製長度
傳回值
int 操作結果

◆ insertArray() [2/2]

int ufm::lang::Data::insertArray ( const void * source,
int start,
int length )
inline

將來源陣列資料插入到 Data 物件中

參數
source來源資料指標
start插入起始位置
length插入長度
傳回值
int 操作結果

◆ isReadOnly()

bool ufm::lang::Data::isReadOnly ( void ) const
inline

檢查資料是否唯讀

傳回值
true 為唯讀
false 非唯讀

◆ length()

int ufm::lang::Data::length ( void ) const
inline

取得資料有效長度

傳回值
int 長度值

◆ lengthUnsigned()

uint32 ufm::lang::Data::lengthUnsigned ( void ) const
inline

取得資料無符號長度

傳回值
uint32 長度值

◆ operator=()

Data & ufm::lang::Data::operator= ( const Data & other)
default

賦值運算子,將另一個 Data 物件的內容複製到當前物件

參數
other另一個 Data 物件
傳回值
Data& 返回當前物件的參考,以支持鏈式賦值

◆ popArray() [1/3]

int ufm::lang::Data::popArray ( int start,
int length )
inline

從指定起始位置取出陣列資料(不儲存結果)

參數
start起始位置
length取出長度
傳回值
int 取出結果

◆ popArray() [2/3]

int ufm::lang::Data::popArray ( void * source,
int shift,
int start,
int length )

Data 物件中依指定位移取出陣列資料

參數
source儲存資料之指標
shift位移量
start起始位置
length取出長度
傳回值
int 操作結果

◆ popArray() [3/3]

int ufm::lang::Data::popArray ( void * source,
int start,
int length )
inline

從指定起始位置取出陣列資料並儲存至指定來源

參數
source儲存資料之指標
start起始位置
length取出長度
傳回值
int 取出結果

◆ subData()

ufm::lang::Data ufm::lang::Data::subData ( int beginIndex,
int length ) const

取得子資料區段

參數
beginIndex子區段起始索引
length子區段長度
傳回值
ufm::lang::Data 子資料物件

◆ wipe() [1/6]

int ufm::lang::Data::wipe ( uint8 value)
inline

以指定值擦除所有資料

參數
value擦除值
傳回值
int 操作結果

◆ wipe() [2/6]

int ufm::lang::Data::wipe ( uint8 value,
int length )
inline

從起始處以指定長度使用指定值擦除資料

參數
value擦除值
length擦除長度
傳回值
int 操作結果

◆ wipe() [3/6]

int ufm::lang::Data::wipe ( uint8 value,
int start,
int length )

從指定起始位置以指定長度擦除資料

參數
value擦除值
start起始位置
length擦除長度
傳回值
int 操作結果

◆ wipe() [4/6]

static void ufm::lang::Data::wipe ( void * pointer,
int length )
static

根據指定長度擦除記憶體區塊

參數
pointer目標記憶體指標
length擦除長度

◆ wipe() [5/6]

static void ufm::lang::Data::wipe ( void * pointer,
uint8 value,
int length )
static

使用指定值擦除記憶體區塊

參數
pointer目標記憶體指標
value擦除用值
length擦除長度

◆ wipe() [6/6]

int ufm::lang::Data::wipe ( void )
inline

以預設值 0x00 擦除所有資料

傳回值
int 操作結果

此類別(class) 文件是由下列檔案中產生: