本文整理汇总了C++中ZtringListList::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ ZtringListList::empty方法的具体用法?C++ ZtringListList::empty怎么用?C++ ZtringListList::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZtringListList
的用法示例。
在下文中一共展示了ZtringListList::empty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Read_Buffer_Continue
//---------------------------------------------------------------------------
void File_SubRip::Read_Buffer_Continue()
{
if (!IsSub && (Buffer_Size<File_Size && Buffer_Size<65536))
{
Element_WaitForMoreData();
return;
}
ZtringListList Temp;
Temp.Separator_Set(0, __T("\r\n\r\n"));
Temp.Separator_Set(1, __T("\r\n"));
Temp.Write(Ztring().From_UTF8((const char*)Buffer, Buffer_Size>65536?65536:Buffer_Size));
if (Temp.empty())
Temp.Write(Ztring().From_Local((const char*)Buffer, Buffer_Size>65536?65536:Buffer_Size)); // Trying from local code page
size_t IsOk=0;
size_t IsNok=0;
for (size_t Pos=0; Pos<Temp.size(); Pos++)
{
if (Temp(Pos, 0).To_int64u()==Pos+1)
IsOk++;
else
IsNok++;
if (Temp(Pos, 1).size()>22 && Temp(Pos, 1)[2]==__T(':') && Temp(Pos, 1)[5]==__T(':') && Temp(Pos, 1).find(__T(" --> "))!=string::npos)
IsOk++;
else
IsNok++;
}
if (!IsOk || IsNok>IsOk/2)
{
Reject();
return;
}
if (!Status[IsAccepted])
{
Accept();
Fill(Stream_General, 0, General_Format, "SubRip");
Stream_Prepare(Stream_Text);
Fill(Stream_Text, 0, "Format", "SubRip");
Fill(Stream_Text, 0, "Codec", "SubRip");
}
Element_Offset=File_Size;
}
示例2: Fill
//---------------------------------------------------------------------------
void GUI_Main_xxxx__Common::Fill ()
{
//Preparing
Updating=true;
//Showing
ZtringListList List;
List.Separator_Set(0, EOL);
List.Separator_Set(1, _T(","));
List.Write(Fill_Content());
//Elminating unuseful info from filenames
FileName_Before.clear();
if (List.size()==2 && !List[1].empty())
{
size_t ToDelete=List[1][0].rfind(PathSeparator);
if (ToDelete!=string::npos)
{
FileName_Before=List[1][0].substr(0, ToDelete+1);
List[1][0].erase(0, ToDelete+1);
}
}
else if (List.size()>1 && !List[1].empty())
{
size_t ToDelete;
size_t File_Pos;
for (ToDelete=0; ToDelete<List[1][0].size(); ToDelete++)
{
char Char_File1=List[1][0][ToDelete];
for (File_Pos=2; File_Pos<List.size(); File_Pos++)
if (ToDelete>=List[File_Pos][0].size() || List[File_Pos][0][ToDelete]!=Char_File1)
break;
if (File_Pos!=List.size())
break;
}
ToDelete=List[1][0].rfind(PathSeparator, ToDelete);
if (ToDelete!=string::npos)
{
FileName_Before=List[1][0].substr(0, ToDelete+1);
for (File_Pos=1; File_Pos<List.size(); File_Pos++)
List[File_Pos][0].erase(0, ToDelete+1);
}
}
if (List.empty() || List[0].empty())
{
setRowCount(0);
setColumnCount(0);
//Preparing
Updating=false;
return;
}
//Forcing reset, else this seems to be some Qt bug in the table display
setRowCount(0);
setColumnCount(0);
//Filling - HorizontalHeader
setRowCount((int)List.size()-1);
size_t ColumnMissing_Count=0;
for (size_t Option=0; Option<Main->Preferences->Group_Options_Count_Get(Fill_Group()); Option++)
if (!Main->Menu_Fields_CheckBoxes[Fill_Group()*options::MaxCount+Option]->isChecked())
ColumnMissing_Count++;
setColumnCount((int)(List[0].size()-ColumnMissing_Count));
ColumnMissing_Count=0;
for (size_t Data_Pos=0; Data_Pos<List[0].size(); Data_Pos++)
if (Data_Pos==0 || Main->Menu_Fields_CheckBoxes[Fill_Group()*options::MaxCount+Data_Pos-1]->isChecked())
{
QTableWidgetItem* Item=new QTableWidgetItem(QString().fromUtf8(List[0][Data_Pos].To_Local().c_str()));
Item->setToolTip(Columns_ToolTip(List[0][Data_Pos]));
setHorizontalHeaderItem((int)(Data_Pos-ColumnMissing_Count), Item);
}
else
ColumnMissing_Count++;
//Filling - VerticalHeader and content
for (size_t File_Pos=1; File_Pos<List.size(); File_Pos++)
{
if (List[File_Pos].empty())
List[File_Pos].resize(1); //Empty filename, we need to manualy add it.
ColumnMissing_Count=0;
for (size_t Data_Pos=0; Data_Pos<List[0].size(); Data_Pos++)
if (Data_Pos==0 || Main->Menu_Fields_CheckBoxes[Fill_Group()*options::MaxCount+Data_Pos-1]->isChecked())
{
QTableWidgetItem* Item;
if (Data_Pos<List[File_Pos].size())
{
ZenLib::Ztring Value=List[File_Pos][Data_Pos];
Value.FindAndReplace(EOL, "\n", 0, Ztring_Recursive);
Item=new QTableWidgetItem(QString().fromUtf8(Value.To_Local().c_str()));
Item->setToolTip(Columns_ToolTip(List[0][Data_Pos]));
}
else
Item=new QTableWidgetItem(QString());
if (!C->IsValid_Get(FileName_Before+List[File_Pos][0])
//.........这里部分代码省略.........