本文整理汇总了C++中Convert::ConvertToBinary方法的典型用法代码示例。如果您正苦于以下问题:C++ Convert::ConvertToBinary方法的具体用法?C++ Convert::ConvertToBinary怎么用?C++ Convert::ConvertToBinary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Convert
的用法示例。
在下文中一共展示了Convert::ConvertToBinary方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
void Information_Hiding::Execute(ifstream &CoverData, ofstream &StegoData){
Convert convert;
int in = 0;
int index = 0;
int counter = 0;
char CharOfMessBinary[8] = {'\0'};
while(CoverData.good())
{
bool isChange = false;
char CharOfImageBinary[8] = {'\0'};
char c = CoverData.get();
int ascii = (int)c;
int _ascii = abs(ascii);
if(ascii != _ascii) isChange = true;
convert.ConvertToBinary(_ascii, CharOfImageBinary);
if(counter >= 55){
bool flag = false;
//-----------------------------------------------------//
if(index == 0 && in < message.length()-1){
char encodeChar = message[in];
int asc = (int)encodeChar;
convert.ConvertToBinary(asc, CharOfMessBinary);
flag = true;
}
if(in >= message.length() -1 ){
index = -1;
}
//------------------------------------------------------//
if(index != -1){
CharOfImageBinary[7] = CharOfMessBinary[index];
StegoData << convert.ConvertToChar(CharOfImageBinary,isChange);
}
else StegoData << c;
if(index != -1){
index++;
if(index == 8){
index = 0;
in++;
}
}
}
if(counter < 55)
StegoData << c;
counter++;
}
}