• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetCode函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetCode函数的典型用法代码示例。如果您正苦于以下问题:C++ GetCode函数的具体用法?C++ GetCode怎么用?C++ GetCode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetCode函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ATLTRACE

	/// <summary>Read the full method from the supplied buffer.</summary>
	void Method::ReadMethod(IMAGE_COR_ILMETHOD* pMethod)
	{
		BYTE* pCode;
		auto fatImage = static_cast<COR_ILMETHOD_FAT*>(&pMethod->Fat);
		if (!fatImage->IsFat())
		{
			#ifdef TRACE_ENABLED
			ATLTRACE(_T("TINY"));
			#endif
			auto tinyImage = static_cast<COR_ILMETHOD_TINY*>(&pMethod->Tiny);
			m_header.CodeSize = tinyImage->GetCodeSize();
			pCode = tinyImage->GetCode();
			#ifdef TRACE_ENABLED
			ATLTRACE(_T("TINY(%X) => (%d + 1) : %d"), m_header.CodeSize, m_header.CodeSize, m_header.MaxStack);
			#endif		
		}
		else
		{
			memcpy(&m_header, pMethod, fatImage->Size * sizeof(DWORD));
			pCode = fatImage->GetCode();
			#ifdef TRACE_ENABLED
			ATLTRACE(_T("FAT(%X) => (%d + 12) : %d"), m_header.CodeSize, m_header.CodeSize, m_header.MaxStack);
			#endif
		}
		SetBuffer(pCode);
		ReadBody();
	}
开发者ID:secdec,项目名称:codepulse,代码行数:28,代码来源:Method.cpp


示例2: strcpy

int FtpClient::Login()
{
    try
    {
        char buffer[2048];
        int code;
        strcpy ( buffer, "USER " );
        strcat ( buffer, this->userName );
        if(!SendMessage ( buffer ))
	{
	  perror("Can't send message\n");
	  return 1;
	}
        strcpy ( buffer, ReceiveMessage() ); //receiving confirmation
        code = GetCode ( buffer );
        if ( code != 331 ) //if the FTP server sent a code that it's not 331, than we've got problems
            return code;
        strcpy ( buffer, "PASS " );
        strcat ( buffer, password );
        SendMessage ( buffer ); //now we have to send the password
        strcpy ( buffer, ReceiveMessage() );
        code = GetCode ( buffer );
        Sock = _Socket;
        if ( code != 230 ) //if something went wrong, then we send the code back to the calling function
            return code;
    }
    catch ( Exception ex )
    {
        cout << ex.Message;
    }
    return 0; //this means that we are logged in
}
开发者ID:thewindev,项目名称:Ftp-Mirror,代码行数:32,代码来源:FtpClient.cpp


示例3: wxT

void CppCodeGenerator::GenClassDeclaration(shared_ptr<ObjectBase> class_obj, bool use_enum)
{
	shared_ptr<Property> propName = class_obj->GetProperty( wxT("name") );
	if ( !propName )
	{
		wxLogError(wxT("Missing \"name\" property on \"%s\" class. Review your XML object description"),
			class_obj->GetClassName().c_str());
		return;
	}

	wxString class_name = propName->GetValue();
	if ( class_name.empty() )
	{
		wxLogError( wxT("Object name can not be null") );
		return;
	}

	m_header->WriteLn( wxT("/**") );
	m_header->WriteLn( wxT(" * Class ") + class_name);
	m_header->WriteLn( wxT(" */") );

	m_header->WriteLn( wxT("class ") + class_name + wxT(" : ") + GetCode( class_obj, wxT("base") ) );
	m_header->WriteLn( wxT("{") );
	m_header->Indent();

	// private
	m_header->WriteLn( wxT("private:") );
	m_header->Indent();
	GenAttributeDeclaration(class_obj,P_PRIVATE);
	m_header->Unindent();
	m_header->WriteLn( wxT("") );

	// protected
	m_header->WriteLn( wxT("protected:") );
	m_header->Indent();

	if (use_enum)
		GenEnumIds(class_obj);

	GenAttributeDeclaration(class_obj,P_PROTECTED);
	m_header->Unindent();
	m_header->WriteLn( wxT("") );

	// public
	m_header->WriteLn( wxT("public:") );
	m_header->Indent();
	GenAttributeDeclaration(class_obj,P_PUBLIC);

	// The constructor is also included within public
	m_header->WriteLn( GetCode( class_obj, wxT("cons_decl") ) );
	m_header->Unindent();
	m_header->WriteLn( wxT("") );

	m_header->Unindent();
	m_header->WriteLn( wxT("};") );
	m_header->WriteLn( wxT("") );
}
开发者ID:idrassi,项目名称:wxFormBuilder,代码行数:57,代码来源:cppcg.cpp


示例4: OpenFile

void LL1Parsing::LL1()
{
	OpenFile();
	Production();

	FisrtInit();		//FIRST集合初始化
	//l.PrintVariFst();

	GetVariFst();		//求FIRST集
	//l.PrintVariFst();

	GetVariFol();		//求FOLLOW集
	//l.PrintVariFol();

	GetProFst();		//求产生式的FIRST集合
	//l.PrintProFst();

	GetFAATable();	//构造预测分析表
	//l.PrintFAATable();

	stack<int> s;
	enum tokenType token;
	s.push(99);
	s.push(50);
	int top;
	token = GetNewToken();
	do{
		top = s.top();
		
		if (top < t_len || top == 99){
			if (top != 99 && top == GetCode(token)){
				cout << "pop " << top << endl;
				s.pop();
				token = GetNewToken();
			}
			else {
				cerr << "error" << endl;
			}
		}
		else{
			if (faaTable[top - 50][GetCode(token)].size()>0){
				long long int code = faaTable[top - 50][GetCode(token)][0];
				cout << top << "-->" << code << endl;
				s.pop();
				if (code > 0){
					for (size_t j = (int)((GetLength(code) + 1) / 2); j > 0; --j){
						s.push(Get2Code(code, j));
					}
				}
			}
			else {
				cerr << "error" << endl;
			}
		}
	} while (s.top() != 99 && !s.empty());
}
开发者ID:Jesty-Hu,项目名称:Compiler,代码行数:56,代码来源:LL1Parsing.cpp


示例5: GetCode

void PHPCodeGenerator::GenConstructor( PObjectBase class_obj, const EventVector &events )
{
	m_source->WriteLn();
	// generate function definition
	m_source->WriteLn( GetCode( class_obj, wxT("cons_def") ) );
	m_source->Indent();

	m_source->WriteLn( GetCode( class_obj, wxT("cons_call") ) );
	m_source->WriteLn();

	wxString settings = GetCode( class_obj, wxT("settings") );
	if ( !settings.IsEmpty() )
	{
		m_source->WriteLn( settings );
	}

	for ( unsigned int i = 0; i < class_obj->GetChildCount(); i++ )
	{
		GenConstruction( class_obj->GetChild( i ), true );
	}

	wxString afterAddChild = GetCode( class_obj, wxT("after_addchild") );
	if ( !afterAddChild.IsEmpty() )
	{
		m_source->WriteLn( afterAddChild );
	}

	GenEvents( class_obj, events );

	m_source->Unindent();
	m_source->WriteLn( wxT("}") );
	m_source->WriteLn( wxT("") );

	if ( class_obj->GetObjectTypeName() == wxT("wizard") && class_obj->GetChildCount() > 0 )
	{
		m_source->WriteLn( wxT("function AddPage($page){") );
		m_source->Indent();
		m_source->WriteLn( wxT("if(count($this->m_pages) > 0){") );
		m_source->Indent();
		m_source->WriteLn( wxT("$previous_page = $this->m_pages[count($this->m_pages)-1];") );
		m_source->WriteLn( wxT("$page->SetPrev($previous_page);") );
		m_source->WriteLn( wxT("$previous_page->SetNext($page);") );
		m_source->Unindent();
		m_source->WriteLn( wxT("}") );
		m_source->WriteLn( wxT("$this->m_pages[] = $page;") );
		m_source->Unindent();
		m_source->WriteLn( wxT("}") );
	}
}
开发者ID:heyuqi,项目名称:wxFormBuilder,代码行数:49,代码来源:phpcg.cpp


示例6: TEST_F

        TEST_FIXTURE_END_TEST_CASES_BEGIN

        // Verify that the sole owner of an indirect storage will reuse the
        // base register for the direct register after dereferencing.
        TEST_F(ExpressionTree, BaseRegisterReuse)
        {
            auto setup = GetSetup();
            ExpressionNodeFactory e(setup->GetAllocator(), setup->GetCode());

            // Create indirect storage to reference an integer.
            struct Test { int m_dummy; };
            Test testStruct;

            auto & structNode = e.Immediate(&testStruct);
            auto & indirectNode = e.Deref(e.FieldPointer(structNode, &Test::m_dummy));
            indirectNode.IncrementParentCount();

            structNode.CodeGenCache(e);
            indirectNode.CodeGenCache(e);

            auto storage = indirectNode.CodeGen(e);
            auto baseRegister = storage.GetBaseRegister();

            ASSERT_TRUE(storage.ConvertToDirect(false).IsSameHardwareRegister(baseRegister));
        }
开发者ID:BitFunnel,项目名称:BitFunnel,代码行数:25,代码来源:ExpressionTreeTest.cpp


示例7: UpdateData

void CParmChValueDlg::OnChangeCode() 
{
   if (!m_bInit) return;
   UpdateData();
   m_CharStr = CSymbolDlg::CodeToChar(GetCode());
   UpdateData(FALSE);
}
开发者ID:vinnie38170,项目名称:klImageCore,代码行数:7,代码来源:ParmChValueDlg.cpp


示例8: GetCode

  //---------------------------------------------------------------------------
  string_type Value::AsciiDump() const
  {
    stringstream_type ss;

    ss << g_sCmdCode[ GetCode() ];
    ss << _T(" [addr=0x") << std::hex << this << std::dec;
    ss << _T("; pos=") << GetExprPos();
    ss << _T("; type=\"") << GetType() << _T("\"");
    ss << _T("; val=");

    switch(m_cType)
    {
    case 'i': ss << (int_type)m_val.real(); break;
    case 'f': ss << m_val.real(); break;
    case 'm': ss << _T("(matrix)"); break;
    case 's': 
              assert(m_psVal!=nullptr);
              ss << _T("\"") << m_psVal << _T("\""); break;
    }

    ss << ((IsFlagSet(IToken::flVOLATILE)) ? _T("; ") : _T("; not ")) << _T("vol");
    ss << _T("]");

    return ss.str();
  }
开发者ID:boussaffawalid,项目名称:OTB,代码行数:26,代码来源:mpValue.cpp


示例9: CreateListColumns

void pgaStep::ShowTreeDetail(ctlTree *browser, frmMain *form, ctlListView *properties, ctlSQLBox *sqlPane)
{
	if (!expandedKids)
	{
		expandedKids = true;
	}

	if (properties)
	{
		CreateListColumns(properties);

		properties->AppendItem(_("Name"), GetName());
		properties->AppendItem(_("ID"), GetRecId());
		properties->AppendYesNoItem(_("Enabled"), GetEnabled());
		properties->AppendItem(_("Kind"), GetKind());
		if (GetConnStr().IsEmpty())
			properties->AppendItem(_("Database"), GetDbname());
		else
			properties->AppendItem(_("Connection String"), GetConnStr());
		properties->AppendItem(_("Code"), GetCode());
		properties->AppendItem(_("On error"), GetOnError());

		properties->AppendItem(_("Comment"), firstLineOnly(GetComment()));
	}
}
开发者ID:Joe-xXx,项目名称:pgadmin3,代码行数:25,代码来源:pgaStep.cpp


示例10: bzero

char *FtpClient::GetCurrentDirectory()
{
    try
    {
        char buffer[2048];
        bzero ( buffer, 2048 );
        SendMessage ( "PWD" );
        strcpy ( buffer, ReceiveMessage() );
        int code = GetCode ( buffer );
        if ( code == 257 )
        {
            int i = 0;
            for ( i = 0; i < strlen ( buffer ) && buffer[i] != '\"'; i++ );
            char dir[2048];
            bzero ( dir, 2048 );
            strcpy ( dir, buffer + ( i + 1 ) );
	    for ( i = 0; i < strlen ( dir ) && dir[i] != '\"'; i++ );
	    dir[i] = '\0';
            return dir;
        }
        else
            return "error";
    }
    catch ( Exception ex )
    {
        cout << ex.Message;
        return ex.Message;
    }
}
开发者ID:thewindev,项目名称:Ftp-Mirror,代码行数:29,代码来源:FtpClient.cpp


示例11: TEST_F

        TEST_F(Conditional, If)
        {
            auto setup = GetSetup();

            Function<uint64_t,
                        bool,
                        uint64_t,
                        uint64_t> e(setup->GetAllocator(), setup->GetCode());

            auto & test = e.If(e.GetP1(), e.GetP2(), e.GetP3());
            auto function = e.Compile(test);

            bool p1 = true;
            uint64_t p2 = 0xFFFFFFFFFFFFFFFF;
            uint64_t p3 = 0;

            auto expected = p1 ? p2 : p3;
            auto observed = function(p1, p2, p3);

            ASSERT_EQ(expected, observed);

            p1 = false;

            expected = p1 ? p2 : p3;
            observed = function(p1, p2, p3);

            ASSERT_EQ(expected, observed);
        }
开发者ID:ChunHungLiu,项目名称:NativeJIT,代码行数:28,代码来源:ConditionalTest.cpp


示例12: GetCode

//-----------------------------------------------------------------------------------------------
string_type Variable::AsciiDump() const
{
    stringstream_type ss;

    ss << g_sCmdCode[ GetCode() ];
    ss << _T(" [addr=0x") << std::hex << this << std::dec;
    ss << _T("; id=\"") << GetIdent() << _T("\"");
    ss << _T("; type=\"") << GetType() << _T("\"");
    ss << _T("; val=");

    switch(GetType())
    {
    case 'i':
        ss << (int_type)GetFloat();
        break;
    case 'f':
        ss << GetFloat();
        break;
    case 'm':
        ss << _T("(array)");
        break;
    case 's':
        ss << _T("\"") << GetString() << _T("\"");
        break;
    }

    ss << ((IsFlagSet(IToken::flVOLATILE)) ? _T("; ") : _T("; not ")) << _T("volatile");
    ss << _T("]");

    return ss.str();
}
开发者ID:QwZhang,项目名称:gale,代码行数:32,代码来源:mpVariable.cpp


示例13: GetKey

void KeyboardEvent::GetInitDict(KeyboardEventInit& aParam)
{
  GetKey(aParam.mKey);
  GetCode(aParam.mCode);
  aParam.mLocation = Location();
  aParam.mRepeat = Repeat();
  aParam.mIsComposing = IsComposing();

  // legacy attributes
  aParam.mKeyCode = KeyCode();
  aParam.mCharCode = CharCode();
  aParam.mWhich = Which();

  // modifiers from EventModifierInit
  aParam.mCtrlKey = CtrlKey();
  aParam.mShiftKey = ShiftKey();
  aParam.mAltKey = AltKey();
  aParam.mMetaKey = MetaKey();

  WidgetKeyboardEvent* internalEvent = mEvent->AsKeyboardEvent();
  aParam.mModifierAltGraph = internalEvent->IsAltGraph();
  aParam.mModifierCapsLock = internalEvent->IsCapsLocked();
  aParam.mModifierFn = internalEvent->IsFn();
  aParam.mModifierFnLock = internalEvent->IsFnLocked();
  aParam.mModifierNumLock = internalEvent->IsNumLocked();
  aParam.mModifierOS = internalEvent->IsOS();
  aParam.mModifierScrollLock = internalEvent->IsScrollLocked();
  aParam.mModifierSymbol = internalEvent->IsSymbol();
  aParam.mModifierSymbolLock = internalEvent->IsSymbolLocked();

  // EventInit
  aParam.mBubbles =  internalEvent->mFlags.mBubbles;
  aParam.mCancelable = internalEvent->mFlags.mCancelable;
}
开发者ID:bitwiseworks,项目名称:mozilla-os2,代码行数:34,代码来源:KeyboardEvent.cpp


示例14: return

BOOL CUIKeyEvent::IsInverse(const CUIEvent &cOther) const
{
	return (ClassName() == ((const CUIKeyEvent *)&cOther)->ClassName()) &&
		(GetCode() == ((const CUIKeyEvent *)&cOther)->GetCode()) && 
		(((GetType() == UIEVENT_KEYDOWN) && (cOther.GetType() == UIEVENT_KEYUP)) ||
		 ((GetType() == UIEVENT_KEYUP) && (cOther.GetType() == UIEVENT_KEYDOWN)));
}
开发者ID:Joincheng,项目名称:lithtech,代码行数:7,代码来源:UIEvent.cpp


示例15: GetCode

const TCHAR *
NOAAStore::GetCodeT(unsigned index)
{
#ifdef _UNICODE
  const char *code = GetCode(index);

  int length = strlen(code);
  TCHAR *code2 = new TCHAR[length + 1];
  length = MultiByteToWideChar(CP_UTF8, 0, code, length, code2, length);
  code2[length] = _T('\0');

  return code2;
#else
  return GetCode(index);
#endif
}
开发者ID:macsux,项目名称:XCSoar,代码行数:16,代码来源:NOAAStore.cpp


示例16: GetRCCodeNW

int GetRCCodeNW()
{
int b_key=-1,i=-1,debounce=200;
	
	i=GetCode();
	if(i!=-1)
	{
		if(i==b_key)
		{
			usleep(debounce*1000);
			while((i=GetCode())!=-1);
		}
		b_key=i;
	}
	return i;
}
开发者ID:ChakaZulu,项目名称:tuxbox_apps,代码行数:16,代码来源:io.c


示例17: GetCode

void CppCodeGenerator::GenClassDeclaration(PObjectBase class_obj)
{
  string class_name = class_obj->GetProperty("name")->GetValue();

  m_header->WriteLn("/**");
  m_header->WriteLn(" * Class " + class_name);
  m_header->WriteLn(" */");

  m_header->WriteLn("class " + class_name + " : " + GetCode(class_obj,"base"));
  m_header->WriteLn("{");
  m_header->Indent();
  
  // private
  m_header->WriteLn("private:");
  m_header->Indent();  
  GenAttributeDeclaration(class_obj,P_PRIVATE);
  m_header->Unindent();
  m_header->WriteLn("");
  
  // protected
  m_header->WriteLn("protected:");
  m_header->Indent();  
  GenAttributeDeclaration(class_obj,P_PROTECTED);
  m_header->Unindent();
  m_header->WriteLn("");  
  
  // public
  m_header->WriteLn("public:");
  m_header->Indent();  
  GenAttributeDeclaration(class_obj,P_PUBLIC);
  m_header->WriteLn("");
    
  // dentro de public también incluimos el constructor
  m_header->WriteLn(GetCode(class_obj,"cons_decl"));  
  m_header->Unindent();
  m_header->WriteLn("");

    
  m_header->Unindent();
  m_header->WriteLn("};");
  m_header->WriteLn("");
}
开发者ID:idrassi,项目名称:wxFormBuilder,代码行数:42,代码来源:cppcg.cpp


示例18: GetCode

  //---------------------------------------------------------------------------
  string_type TokenNewline::AsciiDump() const
  {
    stringstream_type ss;

    ss << g_sCmdCode[ GetCode() ];
    ss << _T(" [addr=0x") << std::hex << this << std::dec;
    ss << _T("; pos=") << GetExprPos();
    ss << _T("; offset=") << m_nOffset;
    ss << _T("]");
    return ss.str();
  }
开发者ID:cloudqiu1110,项目名称:math-parser-benchmark-project,代码行数:12,代码来源:mpScriptTokens.cpp


示例19: GetCode

//------------------------------------------------------------------------------
string_type IOprtIndex::AsciiDump() const
{
    stringstream_type ss;

    ss << g_sCmdCode[ GetCode() ];
    ss << _T(" [addr=0x") << std::hex << this << std::dec;
    ss << _T("; ident=\"") << GetIdent() << _T("\"");
    ss << _T("; argc=") << GetArgc();
    ss << _T("]");

    return ss.str();
}
开发者ID:QAndot,项目名称:muparser,代码行数:13,代码来源:mpIOprt.cpp


示例20: GetCode

  //------------------------------------------------------------------------------
  string_type ICallback::AsciiDump() const
  {
    stringstream_type ss;

    ss << g_sCmdCode[ GetCode() ];
    ss << _T(" [addr=0x") << std::hex << this << std::dec;
    ss << _T("; ident=\"") << GetIdent() << "\"";
    ss << _T("; argc=") << GetArgc() << " (present: " << m_nArgsPresent << ")";
    ss << _T("]");

    return ss.str();
  }
开发者ID:shadeMe,项目名称:BGSEditorExtenderBase,代码行数:13,代码来源:mpICallback.cpp



注:本文中的GetCode函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetCollectionFactory函数代码示例发布时间:2022-05-30
下一篇:
C++ GetCmd函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap