|
|
|
@ -74,6 +74,14 @@ private: |
|
|
|
|
public: |
|
|
|
|
void Load(std::string file); |
|
|
|
|
void Save(); |
|
|
|
|
void Write(int row,int col,byte val); |
|
|
|
|
void Write(int row,int col,sbyte val); |
|
|
|
|
void Write(int row,int col,int16_t val); |
|
|
|
|
void Write(int row,int col,uint16_t val); |
|
|
|
|
void Write(int row,int col,int32_t val); |
|
|
|
|
void Write(int row,int col,uint32_t val); |
|
|
|
|
void Write(int row,int col,float val); |
|
|
|
|
void Write(int row,int col,std::string val); |
|
|
|
|
SHNFile(); |
|
|
|
|
}; |
|
|
|
|
#ifdef OLC_PGEX_SHNFile |
|
|
|
@ -289,7 +297,7 @@ T SHNFile::Data::Get(){ |
|
|
|
|
} |
|
|
|
|
template<typename T> |
|
|
|
|
void SHNFile::Data::Set(T b){ |
|
|
|
|
data=std::make_shared<T>(T(b)); |
|
|
|
|
data=std::make_shared<T>(b); |
|
|
|
|
} |
|
|
|
|
std::string SHNFile::Data::GetDisplayText(){ |
|
|
|
|
switch(type){ |
|
|
|
@ -454,7 +462,7 @@ void SHNFile::Save(){ |
|
|
|
|
}break; |
|
|
|
|
case 9: |
|
|
|
|
case 0x18:{ |
|
|
|
|
WriteString(f,col.Get<std::string>(),columns[colNum].length); |
|
|
|
|
WriteString(f,std::string(col.Get<std::string>()),columns[colNum].length); |
|
|
|
|
}break; |
|
|
|
|
case 13: |
|
|
|
|
case 0x15:{ |
|
|
|
@ -489,5 +497,29 @@ void SHNFile::Save(){ |
|
|
|
|
WriteBytes(encryptedFile,data); |
|
|
|
|
std::cout<<"File "<<filename<<" Saved!"<<std::endl; |
|
|
|
|
} |
|
|
|
|
void SHNFile::Write(int row,int col,byte val){ |
|
|
|
|
contents[row][col].Set<byte>(val); |
|
|
|
|
} |
|
|
|
|
void SHNFile::Write(int row,int col,sbyte val){ |
|
|
|
|
contents[row][col].Set<sbyte>(val); |
|
|
|
|
} |
|
|
|
|
void SHNFile::Write(int row,int col,int16_t val){ |
|
|
|
|
contents[row][col].Set<int16_t>(val); |
|
|
|
|
} |
|
|
|
|
void SHNFile::Write(int row,int col,uint16_t val){ |
|
|
|
|
contents[row][col].Set<uint16_t>(val); |
|
|
|
|
} |
|
|
|
|
void SHNFile::Write(int row,int col,int32_t val){ |
|
|
|
|
contents[row][col].Set<int32_t>(val); |
|
|
|
|
} |
|
|
|
|
void SHNFile::Write(int row,int col,uint32_t val){ |
|
|
|
|
contents[row][col].Set<uint32_t>(val); |
|
|
|
|
} |
|
|
|
|
void SHNFile::Write(int row,int col,float val){ |
|
|
|
|
contents[row][col].Set<float>(val); |
|
|
|
|
} |
|
|
|
|
void SHNFile::Write(int row,int col,std::string val){ |
|
|
|
|
contents[row][col].Set<std::string>(val); |
|
|
|
|
} |
|
|
|
|
SHNFile::SHNFile(){} |
|
|
|
|
#endif |