本文整理匯總了C++中AddHeader函數的典型用法代碼示例。如果您正苦於以下問題:C++ AddHeader函數的具體用法?C++ AddHeader怎麽用?C++ AddHeader使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了AddHeader函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: switch
/*! \brief Build the code that creates the control.
*
* \return void
*
*/
void wxsLinearRegulator::OnBuildCreatingCode()
{
switch(GetLanguage())
{
case wxsCPP:
{
AddHeader(_T("\"wx/KWIC/LinearRegulator.h\""), GetInfo().ClassName);
Codef(_T("%C(%W,%I,%P,%S, %s);\n"), wxT("wxBORDER_NONE"));
// Default range is 0-100.
if(m_iRangeMin != 0 || m_iRangeMax != 100){
Codef(_T("%ASetRangeVal(%d, %d);\n"), static_cast<int>(m_iRangeMin), static_cast<int>(m_iRangeMax));
}
if(!m_bHorizontal){
Codef(_T("%ASetOrizDirection(false);\n"));
}
if(!m_bShowVal){
Codef(_T("%AShowCurrent(false);\n"));
}
if(!m_bShowLimits){
Codef(_T("%AShowLimits(false);\n"));
}
wxString ss = m_cdActiveBarColour.BuildCode(GetCoderContext());
if(!ss.IsEmpty()) Codef(_T("%ASetActiveBarColour(%s);\n"), ss.wx_str());
ss = m_cdPassiveBarColour.BuildCode(GetCoderContext());
if(!ss.IsEmpty()) Codef(_T("%ASetPassiveBarColour(%s);\n"), ss.wx_str());
ss = m_cdBorderColour.BuildCode(GetCoderContext());
if(!ss.IsEmpty()) Codef(_T("%ASetBorderColour(%s);\n"), ss.wx_str());
ss = m_cdLimitTextColour.BuildCode(GetCoderContext());
if(!ss.IsEmpty()) Codef(_T("%ASetTxtLimitColour(%s);\n"), ss.wx_str());
ss = m_cdValueTextColour.BuildCode(GetCoderContext());
if(!ss.IsEmpty()) Codef(_T("%ASetTxtValueColour(%s);\n"), ss.wx_str());
ss = m_cdTagColour.BuildCode(GetCoderContext());
if(!ss.IsEmpty()) Codef(_T("%ASetTagsColour(%s);\n"), ss.wx_str());
for(size_t i = 0; i < m_arrTags.Count(); i++){
TagDesc *Desc = m_arrTags[i];
Codef(_T("\t%AAddTag(%d);\n"), Desc->val);
}
ss = GetCoderContext()->GetUniqueName(_T("LinearRegulatorFont"));
wxString sFnt = m_fnt.BuildFontCode(ss, GetCoderContext());
if(sFnt.Len() > 0)
{
Codef(_T("%s"), sFnt.wx_str());
Codef(_T("%ASetTxtFont(%s);\n"), ss.wx_str());
}
// Value needs to be set after other params for correct display.
if(m_iValue){
Codef(_T("%ASetValue(%d);\n"), static_cast<int>(m_iValue));
}
BuildSetupWindowCode();
break;
}
case wxsUnknownLanguage: // fall-through
default:
wxsCodeMarks::Unknown(_T("wxsLinearRegulator::OnBuildCreatingCode"), GetLanguage());
}
}
示例2: switch
/*! \brief Create the dialogue.
*
* \return void
*
*/
void wxsPrintDialog::OnBuildCreatingCode()
{
switch ( GetLanguage() )
{
case wxsCPP:
{
AddHeader(_T("<wx/printdlg.h>"),GetInfo().ClassName,hfInPCH);
wxString sDataName = GetCoderContext()->GetUniqueName(_T("printDialogData"));
AddDeclaration(wxString::Format(wxT("wxPrintDialogData *%s;"), sDataName.wx_str()));
Codef(_T("\t%s = new wxPrintDialogData;\n"), sDataName.wx_str());
if(m_bEnableHelp){
Codef(_T("\t%s->EnableHelp(%b);\n"), sDataName.wx_str(), m_bEnableHelp);
}
if(!m_bEnablePageNumbers){
Codef(_T("\t%s->EnablePageNumbers(%b);\n"), sDataName.wx_str(), m_bEnablePageNumbers);
}
if(!m_bEnablePrintToFile){
Codef(_T("\t%s->EnablePrintToFile(%b);\n"), sDataName.wx_str(), m_bEnablePrintToFile);
}
if(m_bEnableSelection){
Codef(_T("\t%s->EnableSelection(%b);\n"), sDataName.wx_str(), m_bEnableSelection);
if(m_bSelection){
Codef(_T("\t%s->SetSelection(%b);\n"), sDataName.wx_str(), m_bSelection);
}
}
if(m_bCollate){
Codef(_T("\t%s->SetCollate(%b);\n"), sDataName.wx_str(), m_bCollate);
}
if(m_iFromPage > 0){
Codef(_T("\t%s->SetFromPage(%d);\n"), sDataName.wx_str(), m_iFromPage);
}
if(m_iToPage > 0){
Codef(_T("\t%s->SetToPage(%d);\n"), sDataName.wx_str(), m_iToPage);
}
if(m_iMinPage > 0){
Codef(_T("\t%s->SetMinPage(%d);\n"), sDataName.wx_str(), m_iMinPage);
}
if(m_iMaxPage > 0){
Codef(_T("\t%s->SetMaxPage(%d);\n"), sDataName.wx_str(), m_iMaxPage);
}
if(m_iNoCopies > 1){
Codef(_T("\t%s->SetNoCopies(%d);\n"), sDataName.wx_str(), m_iNoCopies);
}
Codef(_T("%C(%W, %v);\n"), sDataName.wx_str());
BuildSetupWindowCode();
return;
}
default:
{
wxsCodeMarks::Unknown(_T("wxsPrintDialog::OnBuildCreatingCode"),GetLanguage());
}
}
}
示例3: SHVVA_START
/*************************************
* AddHeader
*************************************/
void SHVTestLoggerConsole::AddHeader(const SHVTChar* s, ...)
{
SHVString str;
SHVVA_LIST args;
SHVVA_START(args, s);
str.FormatList(s,args);
AddHeader(str);
SHVVA_END(args);
}
示例4: switch
void wxsCalendarCtrl::OnBuildCreatingCode()
{
switch ( GetLanguage() )
{
case wxsCPP:
{
AddHeader(_T("<wx/calctrl.h>"),GetInfo().ClassName,0);
AddHeader(_T("<wx/calctrl.h>"),_T("wxCalendarEvent"),0);
Codef(_T("%C(%W, %I, wxDefaultDateTime, %P, %S, %T, %N);\n"));
BuildSetupWindowCode();
return;
}
default:
{
wxsCodeMarks::Unknown(_T("wxsCalendarCtrl::OnBuildCreatingCode"),GetLanguage());
}
}
}
示例5: switch
void wxsTimePickerCtrl::OnBuildCreatingCode()
{
switch ( GetLanguage() )
{
case wxsCPP:
{
AddHeader(_T("<wx/timectrl.h>"),GetInfo().ClassName,0);
AddHeader(_T("<wx/dateevt.h>"),_T("wxDateEvent"),0);
Codef(_T("%C(%W, %I, wxDateTime::Now(), %P, %S, %T, %V, %N);\n"));
BuildSetupWindowCode();
return;
}
default:
{
wxsCodeMarks::Unknown(_T("wxsTimePickerCtrl::OnBuildCreatingCode"),GetLanguage());
}
}
}
示例6: astman_get_header
void *ProxyLogoff(struct mansession *s, struct message *m) {
struct message mo;
char *actionid = actionid = astman_get_header(m, "ActionID");
memset(&mo, 0, sizeof(struct message));
AddHeader(&mo, "Response: Goodbye");
AddHeader(&mo, "Message: Thanks for all the fish.");
if( actionid && strlen(actionid) > 0 )
AddHeader(&mo, "ActionID: %s", actionid);
s->output->write(s, &mo);
FreeHeaders(&mo);
destroy_session(s);
if (debug)
debugmsg("Client logged off - exiting thread");
pthread_exit(NULL);
return 0;
}
示例7: AddHeader
void CFireView::OnShowWindow(BOOL bShow, UINT nStatus)
{
CFormView::OnShowWindow(bShow, nStatus);
AddHeader(_T("Dest IP"));
AddHeader(_T("Dest MASK"));
AddHeader(_T("Dest PORT"));
AddHeader(_T("Source IP"));
AddHeader(_T("Source MASK"));
AddHeader(_T("Source PORT"));
AddHeader(_T("PROTOCOL"));
AddHeader(_T("ACTION"));
}
示例8: OrthancException
void HttpOutput::StateMachine::SetCookie(const std::string& cookie,
const std::string& value)
{
if (state_ != State_WritingHeader)
{
throw OrthancException(ErrorCode_BadSequenceOfCalls);
}
// TODO Escape "=" characters
AddHeader("Set-Cookie", cookie + "=" + value);
}
示例9: memset
void *ProxyListIOHandlers(struct mansession *s) {
struct message m;
struct iohandler *i;
memset(&m, 0, sizeof(struct message));
AddHeader(&m, "ProxyResponse: Success");
i = iohandlers;
while (i && (m.hdrcount < MAX_HEADERS - 1) ) {
if (i->read)
AddHeader(&m, "InputHandler: %s", i->formatname);
if (i->write)
AddHeader(&m, "OutputHandler: %s", i->formatname);
i = i->next;
}
s->output->write(s, &m);
FreeHeaders(&m);
return 0;
}
示例10: ProxyAddServer
int ProxyAddServer(struct mansession *s, struct message *m) {
struct message mo;
struct ast_server *srv;
int res = 0;
/* malloc ourselves a server credentials structure */
srv = malloc(sizeof(struct ast_server));
if ( !srv ) {
fprintf(stderr, "Failed to allocate server credentials: %s\n", strerror(errno));
exit(1);
}
memset(srv, 0, sizeof(struct ast_server) );
memset(&mo, 0, sizeof(struct message));
strcpy(srv->ast_host, astman_get_header(m, "Server"));
strcpy(srv->ast_user, astman_get_header(m, "Username"));
strcpy(srv->ast_pass, astman_get_header(m, "Secret"));
strcpy(srv->ast_port, astman_get_header(m, "Port"));
strcpy(srv->ast_events, astman_get_header(m, "Events"));
if (*srv->ast_host && *srv->ast_user && *srv->ast_pass && *srv->ast_port && *srv->ast_events) {
pthread_mutex_lock(&serverlock);
srv->next = pc.serverlist;
pc.serverlist = srv;
pthread_mutex_unlock(&serverlock);
res = StartServer(srv);
} else
res = 1;
if (res) {
AddHeader(&mo, "ProxyResponse: Failure");
AddHeader(&mo, "Message: Could not add %s", srv->ast_host);
} else {
AddHeader(&mo, "ProxyResponse: Success");
AddHeader(&mo, "Message: Added %s", srv->ast_host);
}
s->output->write(s, &mo);
FreeHeaders(&mo);
return 0;
}
示例11: MHD_create_response_from_data
int CWebServer::CreateRedirect(struct MHD_Connection *connection, const std::string &strURL, struct MHD_Response *&response)
{
response = MHD_create_response_from_data(0, NULL, MHD_NO, MHD_NO);
if (response == NULL)
{
CLog::Log(LOGERROR, "CWebServer: failed to create HTTP redirect response to %s", strURL.c_str());
return MHD_NO;
}
AddHeader(response, MHD_HTTP_HEADER_LOCATION, strURL);
return MHD_YES;
}
示例12: switch
/*! \brief Create the initial control.
*
* \return void
*
*/
void wxsImageList::OnBuildCreatingCode()
{
int i;
wxString inc;
wxString vname; // this variable name
wxString bname; // name of the bitmap variable
wxString fbase; // base name of XPM file without dirs or extension
wxString fabs; // absolute name of XPM file
wxString frel; // relative
wxString dname; // name of XPM data array
wxBitmap bmp; // preview bitmap saved as XPM
wxString ss, tt; // general use
// have we already been here?
if(m_IsBuilt){
return;
}
m_IsBuilt = true;
switch(GetLanguage())
{
case wxsCPP:
{
AddHeader(_("<wx/imaglist.h>"), GetInfo().ClassName, 0);
// store the XPM data someplace
StoreXpmData();
vname = GetVarName();
// if there is no data, then just make empty image and bitmap
if(m_Count == 0){
Codef(_T("%s = new wxImageList(%d, %d, 1);\n"), vname.wx_str(), m_Width, m_Height);
}
// else fill it with XPM data
else{
Codef(_T("%s = new wxImageList(%d, %d, %d);\n"), vname.wx_str(), m_Width, m_Height, (m_Count + 1));
for(i = 0; i < m_Count; i++) {
ss.Printf(_("%s_%d_XPM"), vname.wx_str(), i);
Codef(_T("%s->Add(wxBitmap(%s));\n"), vname.wx_str(), ss.wx_str());
}
}
BuildSetupWindowCode();
return;
}
case wxsUnknownLanguage: // fall through
default:
{
wxsCodeMarks::Unknown(_T("wxsImageList::OnBuildCreatingCode"), GetLanguage());
}
}
}
示例13: create_response
int CWebServer::CreateRedirect(struct MHD_Connection *connection, const std::string &strURL, struct MHD_Response *&response) const
{
response = create_response(0, nullptr, MHD_NO, MHD_NO);
if (response == nullptr)
{
CLog::Log(LOGERROR, "CWebServer[%hu]: failed to create HTTP redirect response to %s", m_port, strURL.c_str());
return MHD_NO;
}
AddHeader(response, MHD_HTTP_HEADER_LOCATION, strURL);
return MHD_YES;
}
示例14: DEBUG
bool CHTTPSock::Redirect(const CString& sURL) {
if (SentHeader()) {
DEBUG("Redirect() - Header was already sent");
return false;
}
DEBUG("- Redirect to [" << sURL << "]");
AddHeader("Location", sURL);
PrintErrorPage(302, "Found", "The document has moved <a href=\"" + sURL.Escape_n(CString::EHTML) + "\">here</a>.");
return true;
}
示例15: SetPPQN
bool TriAcePS1Seq::GetHeaderInfo(void) {
SetPPQN(0x30);
header = AddHeader(dwOffset, 0xD5);
header->AddSimpleItem(dwOffset + 2, 2, L"Size");
header->AddSimpleItem(dwOffset + 0xB, 4, L"Song title");
header->AddSimpleItem(dwOffset + 0xF, 1, L"BPM");
header->AddSimpleItem(dwOffset + 0x10, 2, L"Time Signature");
unLength = GetShort(dwOffset + 2);
AlwaysWriteInitialTempo(GetByte(dwOffset + 0xF));
return true;
}