renamed to DataArray instead of MemBlock
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include<hgl/type/MemBlock.h>
|
||||
#include<hgl/type/DataArray.h>
|
||||
#include<hgl/io/FileInputStream.h>
|
||||
namespace hgl
|
||||
{
|
||||
/**
|
||||
* 加载一个文件到内存块类中
|
||||
* 加载一个文件到数据阵列中
|
||||
*/
|
||||
template<typename T> MemBlock<T> *LoadFileToMemBlock(const OSString &filename)
|
||||
template<typename T> static DataArray<T> *LoadFileToDataArray(const OSString &filename)
|
||||
{
|
||||
io::FileInputStream fis;
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace hgl
|
||||
const size_t file_size =fis.GetSize();
|
||||
const size_t size =(file_size+sizeof(T)-1)/sizeof(T);
|
||||
|
||||
MemBlock<T> *mb=new MemBlock<T>(size);
|
||||
DataArray<T> *mb=new DataArray<T>(size);
|
||||
|
||||
fis.Read(mb->data(),file_size);
|
||||
|
@@ -1,13 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include<hgl/type/MemBlock.h>
|
||||
#include<hgl/type/DataArray.h>
|
||||
#include<hgl/filesystem/FileSystem.h>
|
||||
namespace hgl
|
||||
{
|
||||
/**
|
||||
* 保存一个内存块到文件
|
||||
* 保存一个数据阵列到文件
|
||||
*/
|
||||
template<typename T> bool SaveMemBlockToFile(const OSString &filename,const MemBlock<T> &mb)
|
||||
template<typename T> static bool SaveDataArrayToFile(const OSString &filename,const DataArray<T> &mb)
|
||||
{
|
||||
const size_t size=mb.bytes();
|
||||
|
Reference in New Issue
Block a user