本文整理汇总了C++中Reject函数的典型用法代码示例。如果您正苦于以下问题:C++ Reject函数的具体用法?C++ Reject怎么用?C++ Reject使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Reject函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Reject
//---------------------------------------------------------------------------
void File_Tar::Read_Buffer_Continue()
{
if (File_Size<257)
{
Reject();
return;
}
if (Buffer_Size<257)
return; //Wait for more data
//Parsing
Ztring ChecksumO;
Skip_Local(100, "File name");
Skip_Local( 8, "File mode");
Skip_Local( 8, "Owner's numeric user ID");
Skip_Local( 12, "Group's numeric user ID");
Skip_Local( 12, "File size in bytes");
Skip_Local( 8, "Last modification time in numeric Unix time format");
Get_Local ( 8, ChecksumO, "Checksum for header block");
Skip_B1( "Link indicator (file type)");
Skip_Local(100, "Name of linked file");
Skip_XX(File_Size-257, "Data");
FILLING_BEGIN();
//Handling Checksum
int32u Checksum=ChecksumO.To_int32u(8);
int32u ChecksumU=0;
int32u ChecksumS=0;
for (size_t Pos=0; Pos<257; Pos++)
{
if (Pos==148)
{
ChecksumU+=32*8; //8 spaces
ChecksumS+=32*8; //8 spaces
Pos+=7; //Skiping Checksum
}
ChecksumU+=(int8u)Buffer[Pos];
ChecksumS+=(int8s)Buffer[Pos];
}
if (ChecksumU!=Checksum && ChecksumS!=Checksum)
{
Reject("Tar");
return;
}
//Filling
Accept("Tar");
Fill(Stream_General, 0, General_Format, "Tar");
Reject("Tar");
FILLING_END();
}
示例2: while
//---------------------------------------------------------------------------
bool File_Exr::Header_Begin()
{
//Header
if (Buffer_Offset+4>Buffer_Size)
return false;
if (CC4(Buffer+Buffer_Offset)==0x762F3101) //"v/1"+1
return Buffer_Offset+12<=Buffer_Size;
//Name
name_End=0;
while (Buffer_Offset+name_End<Buffer_Size)
{
if (Buffer[Buffer_Offset+name_End]=='\0')
break;
if (name_End==31)
break;
name_End++;
}
if (Buffer_Offset+name_End>=Buffer_Size)
return false;
if (name_End>=31)
{
Reject();
return false;
}
if (name_End==0)
return true;
//Type
type_End=0;
while (Buffer_Offset+name_End+1+type_End<Buffer_Size)
{
if (Buffer[Buffer_Offset+name_End+1+type_End]=='\0')
break;
if (type_End==31)
break;
type_End++;
}
if (Buffer_Offset+name_End+1+type_End>=Buffer_Size)
return false;
if (type_End>=31)
{
Reject();
return false;
}
if (Buffer_Offset+name_End+1+type_End+1+4>=Buffer_Size)
return false;
return true;
}
示例3: Reject
//---------------------------------------------------------------------------
bool File_Png::FileHeader_Begin()
{
//Element_Size
if (Buffer_Size<8)
return false; //Must wait for more data
if (CC4(Buffer+4)!=0x0D0A1A0A) //Byte order
{
Reject("PNG");
return false;
}
switch (CC4(Buffer)) //Signature
{
case 0x89504E47 :
Accept("PNG");
Fill(Stream_General, 0, General_Format, "PNG");
Fill(StreamKind_Last, 0, Fill_Parameter(StreamKind_Last, Generic_Format), "PNG");
Fill(StreamKind_Last, 0, Fill_Parameter(StreamKind_Last, Generic_Codec), "PNG");
break;
case 0x8A4E4E47 :
Accept("PNG");
Fill(Stream_General, 0, General_Format, "MNG");
Fill(StreamKind_Last, 0, Fill_Parameter(StreamKind_Last, Generic_Format), "MNG");
Fill(StreamKind_Last, 0, Fill_Parameter(StreamKind_Last, Generic_Codec), "MNG");
Finish("PNG");
break;
case 0x8B4A4E47 :
Accept("PNG");
Fill(Stream_General, 0, General_Format, "JNG");
Fill(StreamKind_Last, 0, Fill_Parameter(StreamKind_Last, Generic_Format), "JNG");
Fill(StreamKind_Last, 0, Fill_Parameter(StreamKind_Last, Generic_Codec), "JNG");
Finish("PNG");
break;
default:
Reject("PNG");
}
//All should be OK...
return true;
}
示例4: Reject
// private void OnLoadError() [instance] :36
void VideoLoader__VideoPromise::OnLoadError()
{
_readyToDispose = true;
if (!_isCancelled)
Reject(::g::Uno::Exception::New2(::STRINGS[0/*"Failed to l...*/]));
}
示例5: QWidget
void VideoSessionWidget::ShowConfirmationWidget()
{
// Init widgets
internal_widget_ = new QWidget();
internal_v_layout_ = new QVBoxLayout(internal_widget_);
internal_h_layout_ = new QHBoxLayout();
QLabel *question_label = new QLabel(QString("%1 wants to start a video conversation with you").arg(his_name_));
QPushButton *accept_button = new QPushButton("Accept", internal_widget_);
QPushButton *decline_button = new QPushButton("Decline", internal_widget_);
// Stylesheets for background and text color
internal_widget_->setObjectName("confirmationWidget");
internal_widget_->setStyleSheet("");
internal_widget_->setStyleSheet(QString("QWidget#confirmationWidget { background-color: rgba(255,255,255,0); } QLabel { color: rgb(0,0,0); }"));
// Add widgets to layouts
internal_h_layout_->setSpacing(6);
internal_h_layout_->addSpacerItem(new QSpacerItem(1,1, QSizePolicy::Expanding, QSizePolicy::Preferred));
internal_h_layout_->addWidget(question_label);
internal_h_layout_->addWidget(accept_button);
internal_h_layout_->addWidget(decline_button);
internal_h_layout_->addSpacerItem(new QSpacerItem(1,1, QSizePolicy::Expanding, QSizePolicy::Preferred));
internal_v_layout_->addSpacerItem(new QSpacerItem(1,1, QSizePolicy::Preferred, QSizePolicy::Expanding));
internal_v_layout_->addLayout(internal_h_layout_);
internal_v_layout_->addSpacerItem(new QSpacerItem(1,1, QSizePolicy::Preferred, QSizePolicy::Expanding));
// Add bottom layout to widget, insert widget at top of parent widgets layout
internal_widget_->setLayout(internal_v_layout_);
video_session_ui_.mainVerticalLayout->insertWidget(0, internal_widget_);
// Connect signals
connect(accept_button, SIGNAL( clicked() ), video_session_, SLOT( Accept() ));
connect(decline_button, SIGNAL( clicked() ), video_session_, SLOT( Reject() ));
}
示例6: Reject
//---------------------------------------------------------------------------
void File_Lyrics3::Read_Buffer_Continue()
{
if (TotalSize==(int64u)-1)
TotalSize=Buffer_Size;
//Coherency
if (TotalSize<20)
{
Reject("Lyrics3");
return;
}
//Buffer size
if (Buffer_Size<TotalSize)
return;
//Parsing
Element_Offset=0;
Element_Size=TotalSize;
Skip_Local(11, "Signature");
Skip_Local(TotalSize-20, "Lyrics");
Skip_Local(9, "Signature");
//Filling
Accept("Lyric3");
Stream_Prepare(Stream_Text);
Fill(Stream_Text, 0, Text_Codec, "Lyrics3");
Finish("Lyrics3");
}
示例7: Element_Begin1
//---------------------------------------------------------------------------
void File_Cdp::cdp_header()
{
Element_Begin1("cdp_header");
int16u cdp_identifier;
int8u cdp_frame_rate;
Get_B2 ( cdp_identifier, "cdp_identifier");
Skip_B1( "cdp_length");
BS_Begin();
Get_S1 (4, cdp_frame_rate, "cdp_frame_rate"); Param_Info1(Ztring::ToZtring(Cdp_cdp_frame_rate(cdp_frame_rate))+__T(" fps"));
Skip_S1(4, "Reserved");
Skip_SB( "time_code_present");
Skip_SB( "ccdata_present");
Skip_SB( "svcinfo_present");
Skip_SB( "svc_info_start");
Skip_SB( "svc_info_change");
Skip_SB( "svc_info_complete");
Skip_SB( "caption_service_active");
Skip_SB( "Reserved");
BS_End();
Skip_B2( "cdp_hdr_sequence_cntr");
Element_End0();
FILLING_BEGIN();
if (!Status[IsAccepted])
{
if (cdp_identifier!=0x9669)
{
Reject("CDP");
return;
}
Accept("CDP");
}
FILLING_END();
}
示例8: Owner
void CMultiXProcess::OnNewMsgFromTpm(CMultiXAppMsg &AppMsg)
{
if(Owner()->TpmProcID() == 0)
Owner()->m_TpmProcID = this->ProcessID();
if(Owner()->TpmProcID() != this->ProcessID())
{
Reject();
} else
{
switch(AppMsg.MsgCode())
{
case CMultiXTpmCtrlMsg::ConfigDataMsgCode :
{
OnTpmConfigData(AppMsg);
break;
}
case CMultiXTpmCtrlMsg::ProcessShutdownMsgCode :
OnPrepareForShutdown(AppMsg);
break;
case CMultiXTpmCtrlMsg::ProcessRestartMsgCode :
OnProcessRestart(AppMsg);
break;
case CMultiXTpmCtrlMsg::ProcessSuspendMsgCode :
OnProcessSuspend(AppMsg);
break;
case CMultiXTpmCtrlMsg::ProcessResumeMsgCode :
OnProcessResume(AppMsg);
break;
}
}
AppMsg.Reply(MultiXNoError);
}
示例9: InitIO
void ImageGroundTruthPanelViewer::on_key_down(wxKeyEvent & event)
{
if(event.ControlDown() && event.GetUnicodeKey() == 'O')
{
InitIO();
return;
}
if(mp_ground_truth_manager->IsEmpty())
{
return ;
}
try
{
switch(event.GetKeyCode())
{
case WXK_PAGEUP: LoadNextImage(); break;
case WXK_PAGEDOWN: LoadPreviousImage(); break;
}
if(event.ControlDown())
{
switch(event.GetUnicodeKey())
{
case 'S': Save(); break;
case 'Z': Undo(); break;
case 'Y': Redo(); break;
case 'A': MarkAsBlind(); break;
case 'I': MarkAsUnknown(); break;
case 'R': Reject(); break;
}
}
}
JPB_wx_CATCH("échec de l'ajout d'une boîtes englobante d'occlusion");
}
示例10: Reject
//---------------------------------------------------------------------------
bool File_Y4m::FileHeader_Begin()
{
if (Buffer_Size<10)
return false;
if (!(Buffer[0]==0x59
&& Buffer[1]==0x55
&& Buffer[2]==0x56
&& Buffer[3]==0x34
&& Buffer[4]==0x4D
&& Buffer[5]==0x50
&& Buffer[6]==0x45
&& Buffer[7]==0x47
&& Buffer[8]==0x32
&& Buffer[9]==0x20))
{
Reject();
return false;
}
for (; HeaderEnd<Buffer_Size; HeaderEnd++)
{
if (Buffer[HeaderEnd]==0x0A)
{
Accept();
return true;
}
}
return false;
}
示例11: Reject
//---------------------------------------------------------------------------
bool File_ArriRaw::FileHeader_Begin()
{
// Minimum buffer size
if (Buffer_Size<8)
return false; // Must wait for more data
// Testing
if (Buffer[0]!=0x41 // "ARRI.4Vx"
|| Buffer[1]!=0x52
|| Buffer[2]!=0x52
|| Buffer[3]!=0x49
|| Buffer[4]!=0x12
|| Buffer[5]!=0x34
|| Buffer[6]!=0x56
|| Buffer[7]!=0x78)
{
Reject("Arri Raw");
return false;
}
Accept();
//All should be OK...
return true;
}
示例12: Get_B4
//---------------------------------------------------------------------------
void File_Cdp::Read_Buffer_Continue()
{
if (Buffer_Size==0)
return;
if (WithAppleHeader)
{
int32u Size, Magic;
Get_B4 (Size, "Size");
Get_B4 (Magic, "Magic");
FILLING_BEGIN();
if (Magic!=0x63636470)
{
Reject("CDP");
return;
}
FILLING_END();
}
//CRC
int8u CRC=0;
for (size_t Pos=WithAppleHeader?8:0; Pos<Buffer_Size; Pos++)
CRC+=Buffer[Pos];
if (CRC)
{
Skip_XX(Element_Size-Element_Offset, "Invalid data (CRC fails)");
return;
}
cdp_header();
while(Element_Offset<Element_Size)
{
int8u section_id;
Peek_L1(section_id);
switch (section_id)
{
case 0x71 :
time_code_section();
break;
case 0x72 :
ccdata_section();
break;
case 0x73 :
ccsvcinfo_section();
break;
case 0x74 :
cdp_footer();
break;
case 0xFF :
Skip_B1("Padding?");
break;
default :
if (section_id>=0x75 && section_id<=0xEF)
future_section();
else
Skip_XX(Element_Size-Element_Offset, "Unknown");
}
}
}
示例13: BS_Begin
//---------------------------------------------------------------------------
void File_DolbyE::Data_Parse()
{
//In case of scrambling
const int8u* Save_Buffer=NULL;
size_t Save_Buffer_Offset=0;
int64u Save_File_Offset=0;
if (ScrambledBitStream)
{
//We must change the buffer,
Save_Buffer=Buffer;
Save_Buffer_Offset=Buffer_Offset;
Save_File_Offset=File_Offset;
File_Offset+=Buffer_Offset;
Buffer_Offset=0;
Descrambled_Buffer=new int8u[(size_t)Element_Size];
std::memcpy(Descrambled_Buffer, Save_Buffer+Save_Buffer_Offset, (size_t)Element_Size);
Buffer=Descrambled_Buffer;
}
//Parsing
BS_Begin();
Block();
BS_End();
//In case of scrambling
if (ScrambledBitStream)
{
delete[] Buffer; Buffer=Save_Buffer;
Buffer_Offset=Save_Buffer_Offset;
File_Offset=Save_File_Offset;
}
FILLING_BEGIN();
if (!Status[IsAccepted])
{
Accept("Dolby E");
//Guard band
GuardBand_Before_Initial=GuardBand_Before;
GuardBand_After_Initial=GuardBand_After;
}
Frame_Count++;
if (Frame_Count_NotParsedIncluded!=(int64u)-1)
Frame_Count_NotParsedIncluded++;
if (Mpegv_frame_rate[FrameRate])
FrameInfo.DUR=float64_int64s(1000000000/Mpegv_frame_rate[FrameRate]);
else
FrameInfo.DUR=(int64u)-1;
if (FrameInfo.DTS!=(int64u)-1)
FrameInfo.PTS=FrameInfo.DTS+=FrameInfo.DUR;
if (Frame_Count==1)
{
Finish("Dolby E");
}
FILLING_END();
if (Frame_Count==0 && Buffer_TotalBytes>Buffer_TotalBytes_FirstSynched_Max)
Reject("Dolby E");
}
示例14: Reject
//---------------------------------------------------------------------------
bool File_Ptx::FileHeader_Begin()
{
if (File_Size<0x100)
{
Reject("Ptx");
return false;
}
//Element_Size
if (11>Buffer_Size)
return false; //Must wait for more data
if (Buffer[ 0x0]!=0x03
|| Buffer[ 0x1]!=0x30
|| Buffer[ 0x2]!=0x30
|| Buffer[ 0x3]!=0x31
|| Buffer[ 0x4]!=0x30
|| Buffer[ 0x5]!=0x31
|| Buffer[ 0x6]!=0x31
|| Buffer[ 0x7]!=0x31
|| Buffer[ 0x8]!=0x31
|| Buffer[ 0x9]!=0x30
|| Buffer[ 0xA]!=0x30
|| Buffer[ 0xB]!=0x31
|| Buffer[ 0xC]!=0x30
|| Buffer[ 0xD]!=0x31
|| Buffer[ 0xE]!=0x30
|| Buffer[ 0xF]!=0x31
|| Buffer[0x10]!=0x31)
{
Reject("Ptx");
return false;
}
//Element_Size
if (Buffer_Size<File_Size)
return false; //Must wait for more data
ReferenceFiles=new File__ReferenceFilesHelper(this, Config);
//All should be OK...
return true;
}
示例15: Reject
//---------------------------------------------------------------------------
bool File_Scc::FileHeader_Begin()
{
//Element_Size
if (File_Size<22)
{
Reject("N19");
return false;
}
if (Buffer_Size<22)
return false; //Must wait for more data
if (Buffer[ 0]!=0x53
|| Buffer[ 1]!=0x63
|| Buffer[ 2]!=0x65
|| Buffer[ 3]!=0x6E
|| Buffer[ 4]!=0x61
|| Buffer[ 5]!=0x72
|| Buffer[ 6]!=0x69
|| Buffer[ 7]!=0x73
|| Buffer[ 8]!=0x74
|| Buffer[ 9]!=0x5F
|| Buffer[10]!=0x53
|| Buffer[11]!=0x43
|| Buffer[12]!=0x43
|| Buffer[13]!=0x20
|| Buffer[14]!=0x56
|| Buffer[15]!=0x31
|| Buffer[16]!=0x2E
|| Buffer[17]!=0x30
)
{
Reject("SCC");
return false;
}
//Element_Size
if (Buffer_Size<File_Size)
return false; //Must wait for more data
//All should be OK...
return true;
}