本文整理汇总了C++中Convert函数的典型用法代码示例。如果您正苦于以下问题:C++ Convert函数的具体用法?C++ Convert怎么用?C++ Convert使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Convert函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: malloc
void MediaLibrary::onMediaThumbnailReady( medialibrary::MediaPtr media, bool success )
{
vlc_ml_event_t ev;
ev.i_type = VLC_ML_EVENT_MEDIA_THUMBNAIL_GENERATED;
ev.media_thumbnail_generated.b_success = success;
auto mPtr = vlc::wrap_cptr<vlc_ml_media_t>(
static_cast<vlc_ml_media_t*>( malloc( sizeof( vlc_ml_media_t ) ) ),
vlc_ml_media_release );
if ( unlikely( mPtr == nullptr ) )
return;
ev.media_thumbnail_generated.p_media = mPtr.get();
if ( Convert( media.get(), *mPtr ) == false )
return;
m_vlc_ml->cbs->pf_send_event( m_vlc_ml, &ev );
}
示例2: Convert
nsresult
Convert(const bt_service_record_t& aIn, BluetoothServiceRecord& aOut)
{
nsresult rv = Convert(aIn.uuid, aOut.mUuid);
if (NS_FAILED(rv)) {
return rv;
}
aOut.mChannel = aIn.channel;
MOZ_ASSERT(sizeof(aIn.name) == sizeof(aOut.mName));
memcpy(aOut.mName, aIn.name, sizeof(aOut.mName));
return NS_OK;
}
示例3: Convert
int Convert(const CString& szSrc, CString& szDst, int nConvertWay)
{
int nSrcLen = szSrc.GetLength();
if(nSrcLen <= 0)
{
szDst.Empty();
return 0;
}
int nResult = 0;
nResult = Convert(szSrc, nSrcLen, szDst.GetBuffer(nSrcLen), nSrcLen, nConvertWay);
ASSERT(nResult <= nSrcLen);
szDst.ReleaseBuffer();
return nResult;
}
示例4: main
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
if (a.arguments().size() != 4) {
std::cout<<std::endl;
std::cout<<"code_highlight -- part of the Seer app: http://1218.io"<<std::endl;
std::cout<<"----------------------------------------------------------"<<std::endl;
std::cout<<"Usage: code_highlight.exe css_filename input_path output_path"<<std::endl;
std::cout<<std::endl;
return -1;
}
Convert(a.arguments().at(1),a.arguments().at(2),a.arguments().at(3));
return 0;
}
示例5: ReadStringArray
void ReadStringArray(ifstream& in, vector<string>& data)
{
data.clear();
int length;
in.read((char*)&length, sizeof(int));
data.resize(length);
for (vector<string>::iterator it = data.begin(); it != data.end(); ++it)
{
int size;
in.read((char*)&size, sizeof(int));
char* buffer = new char[size];
in.read(buffer, sizeof(char) * size);
Convert(buffer, size, *it);
delete [] buffer;
}
}
示例6: main
int main(int argc, char* argv[])
{
//check parameters
if (argc < 2)
{
printf("You need to specify input file(s) in application parameters!\n");
system("pause");
return 0;
}
for (int i = 1; i < argc; i++)
Convert(argv[i]);
system("pause");
return 0;
}
示例7: assert
inline void fast_Ring< TNum, kdefs>::multInvInPlace( TNum & a) const
{
#ifdef SAFE
assert( a==Convert(a) );
#endif
TNum const & res = multiplicativeInverseTable[getSingleIndex( a)];
if (res.isNotZero() )
{
a = res;
}
else
{
std::cerr << "Multiplicative inverse does not exist!" << std::endl;
throw "Multiplicative inverse does not exist!" ;
}
}
示例8: UpdateConvertedSurface
//////////////////////////////////////////////////////////////////////////////
// UpdateConvertedSurface()
// Make sure the bits for a converted surface are available and up to date.
//////////////////////////////////////////////////////////////////////////////
void UpdateConvertedSurface(PixelFormat* ppf, const WinPoint& size, SurfaceData& data, const SurfaceData& dataSource)
{
if( ppf != data.m_ppf )
{
ConstructSurfaceData(data, ppf, size);
}
if( data.m_id != dataSource.m_id )
{
SetSurfaceMode(SurfaceModeDD);
Convert(size, data.m_pd3dtexture, dataSource.m_pd3dtexture);
// Convert(size, data.m_pdds, dataSource.m_pdds);
data.m_id = dataSource.m_id;
}
}
示例9: GetNotRemembered
void userlearn :: GetNotRemembered(std::vector<std::string> &words)
{
char *filename, *name;
name = Convert(username);
filename = Path("record", name, "last.info");
std::ifstream fin(filename);
if (!fin) return;
std::string word;
int rec;
while (!fin.eof())
{
fin >> word >> rec;
if (rec == 0)
words.push_back(word);
}
}
示例10: Convert
nsresult
Convert(const btgatt_gatt_id_t& aIn, BluetoothGattId& aOut)
{
nsresult rv = Convert(aIn.uuid, aOut.mUuid);
if (NS_FAILED(rv)) {
return rv;
}
// HAL uses reversed UUID for GATT
for (uint8_t i = 0; i < sizeof(aOut.mUuid.mUuid) / 2; i++) {
auto temp = aOut.mUuid.mUuid[i];
aOut.mUuid.mUuid[i] = aOut.mUuid.mUuid[sizeof(aOut.mUuid.mUuid) - i - 1];
aOut.mUuid.mUuid[sizeof(aOut.mUuid.mUuid) - i - 1] = temp;
}
aOut.mInstanceId = aIn.inst_id;
return NS_OK;
}
示例11: FindFirstFileA
void ConvertInx::ConvertMonster( const char* Directory )
{
hDirectory = FindFirstFileA( Format( "%s\\char\\monster\\*", Directory ), &DirAttr );
s_Inx InxFile = { 0 };
while( true )
{
if( hDirectory != INVALID_HANDLE_VALUE )
{
if( DirAttr.dwFileAttributes != FILE_ATTRIBUTE_DIRECTORY )
break;
if( DirAttr.dwFileAttributes == FILE_ATTRIBUTE_HIDDEN )
break;
hFile = FindFirstFileA( Format( "%s\\char\\monster\\%s\\*.inx", Directory, DirAttr.cFileName ), &FileAttr );
while( true )
{
if( FileAttr.cFileName[ lstrlenA( FileAttr.cFileName ) - 1 ] == 'x' )
{
if( FileAttr.nFileSizeLow == OLD_INX_SIZE )
{
StringCbCopyA( InxFile.FileName, 256, FileAttr.cFileName );
StringCbCopyA( InxFile.FullPath, 512, Format( "%s\\char\\monster\\%s\\%s",
Directory, DirAttr.cFileName, FileAttr.cFileName ) );
Convert( &InxFile );
};
};
if( FindNextFileA( hFile, &FileAttr ) == FALSE )
break;
};
if( FindNextFileA( hDirectory, &DirAttr ) == FALSE )
{
break;
};
}
else
{
break;
};
};
hDirectory = NULL;
hFile = NULL;
SecureZeroMemory( &DirAttr, sizeof( WIN32_FIND_DATA ) );
SecureZeroMemory( &FileAttr, sizeof( WIN32_FIND_DATA ) );
};
示例12: CheckWord
bool userlearn :: CheckWord(std::string sword)
{
char *filename, *name;
std::string wordr;
name = Convert(username);
filename = Path("record", name, "remembered.info");
std::ifstream fin(filename);
if (!fin)
return false;
while (!fin.eof())
{
getline(fin, wordr);
if (wordr.compare(sword) == 0)
return true;
}
return false;
}
示例13: main
int main (int argc, char * argv[])
{
double dIn;
double dOut;
Measure factor;
char op;
Unit * uIn;
Unit * uOut;
if (argc != 3) GiveUsage();
dIn = atof (argv[1]);
switch (argv[2][0])
{
case 'f': case 'F':
factor = CONVERT_FEETPERMETER;
op = '/';
uIn = &FOOT;
uOut = &METER;
break;
case 'k': case 'K':
factor = CONVERT_SLUGSPERKILOGRAM;
op = '*';
uIn = &KILOGRAM;
uOut = &SLUG;
break;
case 'm': case 'M':
factor = CONVERT_FEETPERMETER;
op = '*';
uIn = &METER;
uOut = &FOOT;
break;
case 's': case 'S':
factor = CONVERT_SLUGSPERKILOGRAM;
op = '/';
uIn = &SLUG;
uOut = &KILOGRAM;
break;
default: GiveUsage(); break;
}
dOut = Convert (dIn, uIn, uOut, op, factor);
cout << dIn << ' ' << uIn->GetName() << " = ";
cout << dOut << ' ' << uOut->GetName() << endl;
exit (0);
}
示例14: main
void main()
{
char Reply;
do
{
char Infix[50], Postfix[50]="";
cout << "Enter an infix expression (e.g. (a+b)/c^2, with no spaces):"<< endl;
cin >> Infix;
Convert(Infix, Postfix);
cout << "The equivalent postfix expression is:" << endl<< Postfix << endl;
cout << endl << "Do another (y/n)? ";
cin >> Reply;
}
while (Reply == 'y');
}
示例15: main
int main(int argc, const char **argv)
{
if (Init(argc,argv) != 0) {
return 0;
}
while (ReadHeader()) {
Convert();
++MemberCount;
}
if (MemberCount == 0) {
MESSAGE(0,("Warning: %s is empty",inpname));
}
Cleanup();
return 0;
}