本文整理汇总了C++中ON_wString::IsNotEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ ON_wString::IsNotEmpty方法的具体用法?C++ ON_wString::IsNotEmpty怎么用?C++ ON_wString::IsNotEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ON_wString
的用法示例。
在下文中一共展示了ON_wString::IsNotEmpty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: source_archive
static const ONX_ErrorCounter Internal_TestFileRead(
ON_TextLog& text_log,
const ON_wString fullpath,
const ON_wString text_log_path,
bool bVerbose
)
{
FILE* fp = nullptr;
fp = ON_FileStream::Open3dmToRead(fullpath);
ONX_ErrorCounter error_counter;
error_counter.ClearLibraryErrorsAndWarnings();
const ON_wString path_to_print
= (text_log_path.IsNotEmpty())
? text_log_path
: fullpath;
for (;;)
{
if (nullptr == fp)
{
text_log.Print(
L"Skipped file: %ls\n",
static_cast<const wchar_t*>(path_to_print)
);
error_counter.IncrementFailureCount();
break;
}
text_log.Print(
L"File name: %ls\n",
static_cast<const wchar_t*>(path_to_print)
);
ON_BinaryFile source_archive(ON::archive_mode::read3dm, fp);
source_archive.SetArchiveFullPath(fullpath);
error_counter += Internal_TestModelRead(text_log, path_to_print, source_archive, bVerbose);
break;
}
if ( nullptr != fp )
{
ON_FileStream::Close(fp);
fp = nullptr;
}
return error_counter;
}
示例2:
bool ON_3dmProperties::Write(ON_BinaryArchive& file) const
{
bool rc = true;
// This short chunk identifies the version of OpenNURBS that was used to write this file.
const unsigned int version_number_to_write = ON_BinaryArchive::ArchiveOpenNURBSVersionToWrite(file.Archive3dmVersion(), ON::Version());
rc = file.BeginWrite3dmChunk(TCODE_PROPERTIES_OPENNURBS_VERSION, version_number_to_write);
if (rc)
rc = file.EndWrite3dmChunk();
if (!rc)
return false;
// This chunk added November 5, 2015
const ON_wString archive_full_path
= file.ArchiveFullPath().IsEmpty()
? m_3dmArchiveFullPathName
: file.ArchiveFullPath();
if (archive_full_path.IsNotEmpty())
{
if (!file.BeginWrite3dmChunk(TCODE_PROPERTIES_AS_FILE_NAME, 0))
return false;
rc = file.WriteString(file.ArchiveFullPath());
if (!file.EndWrite3dmChunk())
rc = false;
if (!rc)
return false;
}
// optional TCODE_PROPERTIES_REVISIONHISTORY chunk - file creation/revision information
if ( rc && m_RevisionHistory.IsValid() ) {
rc = file.BeginWrite3dmChunk(TCODE_PROPERTIES_REVISIONHISTORY,0);
if ( rc ) {
rc = m_RevisionHistory.Write(file);
if ( !file.EndWrite3dmChunk() )
rc = false;
}
}
// optional TCODE_PROPERTIES_NOTES chunk - file notes
if ( rc && m_Notes.IsValid() ) {
rc = file.BeginWrite3dmChunk(TCODE_PROPERTIES_NOTES,0);
if ( rc ) {
rc = m_Notes.Write(file);
if ( !file.EndWrite3dmChunk() )
rc = false;
}
}
//// When merging Mac code please note that the
//// TCODE_PROPERTIES_PREVIEWIMAGE chunk is OBSOLETE.
//// DO NOT WRITE THEM IN V6 FILES. If performance is an
//// issue, we will address it some other way.
// optional TCODE_PROPERTIES_COMPRESSED_PREVIEWIMAGE chunk - bitmap preview
if ( rc && m_PreviewImage.IsValid() && file.Save3dmPreviewImage())
{
rc = file.BeginWrite3dmChunk(TCODE_PROPERTIES_COMPRESSED_PREVIEWIMAGE,0);
if ( rc )
{
rc = m_PreviewImage.WriteCompressed(file);
if ( !file.EndWrite3dmChunk() )
rc = false;
}
}
// optional TCODE_PROPERTIES_APPLICATION chunk - application information
if ( rc && m_Application.IsValid() )
{
rc = file.BeginWrite3dmChunk(TCODE_PROPERTIES_APPLICATION,0);
if ( rc )
{
rc = m_Application.Write(file);
if ( !file.EndWrite3dmChunk() )
rc = false;
}
}
// required TCODE_ENDOFTABLE chunk - marks end of properties table
if ( rc ) {
rc = file.BeginWrite3dmChunk( TCODE_ENDOFTABLE, 0 );
if ( rc ) {
if ( !file.EndWrite3dmChunk() )
rc = false;
}
}
return rc;
}