Example #1
1
void be_attribute::GenerateGetStub (be_ClientImplementation & source)
{
   be_AttStubGenerator stub
   (
      enclosingScope,
      getOpKey,
      getOpKey,
      GetSignature (AT_Implementation, StubClassname ()),
      fieldType,
      FALSE
   );

   stub.Generate (source);
}
Example #2
0
bool TagEntry::operator ==(const TagEntry& rhs)
{
    //Note: tree item id is not used in this function!
    bool res =
        m_scope == rhs.m_scope &&
        m_file == rhs.m_file &&
        m_kind == rhs.m_kind &&
        m_parent == rhs.m_parent &&
        m_pattern == rhs.m_pattern &&
        m_name == rhs.m_name &&
        m_path == rhs.m_path &&
        m_lineNumber == rhs.m_lineNumber &&
        GetInherits() == rhs.GetInherits() &&
        GetAccess() == rhs.GetAccess() &&
        GetSignature() == rhs.GetSignature() &&
        GetTyperef() == rhs.GetTyperef();

    bool res2 = m_scope == rhs.m_scope &&
                m_file == rhs.m_file &&
                m_kind == rhs.m_kind &&
                m_parent == rhs.m_parent &&
                m_pattern == rhs.m_pattern &&
                m_name == rhs.m_name &&
                m_path == rhs.m_path &&
                GetInherits() == rhs.GetInherits() &&
                GetAccess() == rhs.GetAccess() &&
                GetSignature() == rhs.GetSignature() &&
                GetTyperef() == rhs.GetTyperef();

    if (res2 && !res) {
        // the entries are differs only in the line numbers
        m_differOnByLineNumber = true;
    }
    return res;
}
Example #3
0
 bool IsValid() const
 {
   if (pe_file_->Is64())
   {
     return IMAGE_NT_SIGNATURE == GetSignature() &&
            IMAGE_NT_OPTIONAL_HDR64_MAGIC == GetMagic() &&
            IMAGE_FILE_MACHINE_AMD64 == GetMachine();
   }
   else
   {
     return IMAGE_NT_SIGNATURE == GetSignature() &&
            IMAGE_NT_OPTIONAL_HDR32_MAGIC == GetMagic() &&
            IMAGE_FILE_MACHINE_I386 == GetMachine();
   }
 }
Example #4
0
void
be_attribute::GenerateVirtual
(
   be_Source& source,
   const DDS_StdString& className
)
{
   ostream & os = source.Stream();
   be_Tab tab(source);
   DDS_StdString responsibility = NameToString(name());

   if (fieldType)
   {
      // PURE VIRTUAL GET ATTRIBUTE
      os << tab << "virtual " << GetSignature(AT_Declaration, className);
      os << " = 0;" << nl;

      // PURE VIRTUAL SET ATTRIBUTE
      if (!readonly())
      {
         os << tab << "virtual " << SetSignature(AT_Declaration, className, pbtrue);
         os << " = 0;" << nl;
      }
   }
}
Example #5
0
int TagEntry::Store(wxSQLite3Statement& insertPerepareStmnt)
{
    // If this node is a dummy, (IsOk() == false) we dont insert it to database
    if( !IsOk() )
        return TagOk;

    try
    {
        // see TagsDatabase::GetInsertOneStatement() for the order of binding
        insertPerepareStmnt.Bind(1, GetParentId());
        insertPerepareStmnt.Bind(2, GetName());
        insertPerepareStmnt.Bind(3, GetFile());
        insertPerepareStmnt.Bind(4, GetLine());
        insertPerepareStmnt.Bind(5, GetKind());
        insertPerepareStmnt.Bind(6, GetAccess());
        insertPerepareStmnt.Bind(7, GetSignature());
        insertPerepareStmnt.Bind(8, GetPattern());
        insertPerepareStmnt.Bind(9, GetParent());
        insertPerepareStmnt.Bind(10, GetInherits());
        insertPerepareStmnt.Bind(11, GetPath());
        insertPerepareStmnt.Bind(12, GetTyperef());
        insertPerepareStmnt.Bind(13, GetScope());
        insertPerepareStmnt.ExecuteUpdate();
        insertPerepareStmnt.Reset();

    }
    catch(wxSQLite3Exception& exc)
    {
        if(exc.ErrorCodeAsString(exc.GetErrorCode()) == wxT("SQLITE_CONSTRAINT"))
            return TagExist;
        wxLogMessage(exc.GetMessage());
        return TagError;
    }
    return TagOk;
}
// ---------------------------------------------------------------------------
// 
// ------------
bool bXMapJoinOnDir::edit(void* prm){
bArray*				arr=_gapp->selMgr()->elements();
join_prm			prm1,prm2;
bGenericGeoElement	*gref,*geo;
ivertices			*vx;
bool                b1,b2;
long                toofar=0,alreadyjoined=0;

	arr->get(1,&gref);
    gref->getVertices(&prm1.ref);
	
bEventLog	log(_gapp,
                getbundle(),
                kXMapJoinOnDirMessageID,
                GetSignature(this));
   
    for(long i=2;i<=arr->count();i++){
        arr->get(i,&geo);
        geo->getVertices(&vx);
        geo->inval(kOBJ_Vertices_);
        
        prm1.dmax=_dmax;
        prm2=prm1;
        prm1.vx=vx->vx.vx2[0];
        prm1.prev=vx->vx.vx2[1];
        prm2.vx=vx->vx.vx2[vx->nv-1];
        prm2.prev=vx->vx.vx2[vx->nv-2];
        prm1.d=prm2.d=-1;

        b1=process(kExtProcessCallWithParams,&prm1);
        b2=process(kExtProcessCallWithParams,&prm2);
        if(!b2&&!b1){
            toofar++;
            continue;
        }
        if((prm1.d==0)||(prm2.d==0)){
            alreadyjoined++;
            continue;
        }
        geo->inval(kOBJ_Vertices_);
        if(b1&&b2){
            if(prm1.d<=prm2.d){
                vx->vx.vx2[0]=prm1.res;
            }
            else{
                vx->vx.vx2[vx->nv-1]=prm2.res;
            }
        }
        else if(b2&&!b1){
            vx->vx.vx2[vx->nv-1]=prm2.res;
        }
        else{
            vx->vx.vx2[0]=prm1.res;
        }
        geo->setVertices(vx);
    }
	log.close();
    info(toofar,alreadyjoined);	
	return(true);
}
Example #7
0
int TagEntry::Update(wxSQLite3Statement& updatePerepareStmnt)
{
    // If this node is a dummy, (IsOk() == false) we dont update it to database
    if( !IsOk() )
        return TagOk;

    try
    {
        // see TagsDatabase::GetUpdateOneStatement() function for the order of binding
        updatePerepareStmnt.Bind(1, GetParentId());
        updatePerepareStmnt.Bind(2, GetName());
        updatePerepareStmnt.Bind(3, GetFile());
        updatePerepareStmnt.Bind(4, GetLine());
        updatePerepareStmnt.Bind(5, GetAccess());
        updatePerepareStmnt.Bind(6, GetPattern());
        updatePerepareStmnt.Bind(7, GetParent());
        updatePerepareStmnt.Bind(8, GetInherits());
        updatePerepareStmnt.Bind(9, GetTyperef());
        updatePerepareStmnt.Bind(10, GetScope());
        updatePerepareStmnt.Bind(11, GetKind());
        updatePerepareStmnt.Bind(12, GetSignature());
        updatePerepareStmnt.Bind(13, GetPath());
        updatePerepareStmnt.ExecuteUpdate();
        updatePerepareStmnt.Reset();
    }
    catch(wxSQLite3Exception& exc)
    {
        wxLogMessage(exc.GetMessage());
        return TagError;
    }
    return TagOk;
}
int         CasteroidIGC::Export(void* data) const
{
    if (data)
    {
        DataAsteroidIGC*  dataAsteroid = (DataAsteroidIGC*)data;
        dataAsteroid->asteroidDef = m_asteroidDef;

        dataAsteroid->position = GetPosition();
        {
            const Orientation&  o = GetOrientation();
            dataAsteroid->forward = o.GetForward();
            dataAsteroid->up      = o.GetUp();
        }
        dataAsteroid->rotation = GetRotation();

        assert (GetCluster());
        dataAsteroid->clusterID = GetCluster()->GetObjectID();
        dataAsteroid->signature = GetSignature();

        dataAsteroid->fraction = m_fraction;
        
        const char* pszName = GetName();
        if (*pszName == '\0')
            memcpy(dataAsteroid->name, GetName(), sizeof(dataAsteroid->name));
        else
            UTL::putName(dataAsteroid->name, GetName());
    }

    return sizeof(DataAsteroidIGC);
}
Example #9
0
wxString TagEntry::Key() const
{
    wxString key;
    if( GetKind() == wxT("prototype"))
        key << wxT("[prototype] ");
    key << GetPath() << GetSignature();
    return key;
}
// ---------------------------------------------------------------------------
// 
// ------------
void bXMapReverse::reverse(){
bEventLog	log(_gapp,
				getbundle(),
				kXMapReverseMessageID,
				GetSignature(this));
	reverse(0);
	log.close();
}
Example #11
0
EXTERN_C
BOOL
PALAPI
CryptVerifySignatureW(
    HCRYPTHASH hHash,
    CONST BYTE *pbSignature,
    DWORD dwSigLen,
    HCRYPTKEY hPubKey,
    LPCWSTR szDescription,
    DWORD dwFlags)
{
    BYTE *pbDecryptedSignature;
    BYTE *pbMasterSignature;
    CryptKey *pKey;

    if ((hHash == NULL) || (hPubKey == NULL))
    {
        SetLastError(ERROR_INVALID_HANDLE);
        return FALSE;
    }

    if (dwFlags != 0)
    {
        SetLastError(NTE_BAD_FLAGS);
        return FALSE;
    }

    _ASSERTE(szDescription == NULL);

    pKey = (CryptKey*)hPubKey;

    if (dwSigLen != pKey->GetSignatureLength())
    {
        SetLastError(NTE_SIGNATURE_FILE_BAD);
        return FALSE;
    }

    pbDecryptedSignature = (BYTE*)alloca(dwSigLen);
    if (!pKey->DecryptSignature(pbSignature, pbDecryptedSignature))
    {
        return FALSE;
    }

    pbMasterSignature = (BYTE*)alloca(dwSigLen);
    if (!GetSignature(hHash, pbMasterSignature, dwSigLen))
    {
        return FALSE;
    }

    if (memcmp(pbMasterSignature, pbDecryptedSignature, dwSigLen) != 0)
    {
        SetLastError(NTE_BAD_SIGNATURE);
        return FALSE;
    }

    return TRUE;
}
wxString TagEntry::Key() const
{
    wxString key;
    if(GetKind() == wxT("prototype") || GetKind() == wxT("macro")) {
        key << GetKind() << wxT(": ");
    }

    key << GetPath() << GetSignature();
    return key;
}
Example #13
0
StdString VMMethod::AsDebugString() const {
    VMClass* holder = GetHolder();
    StdString holder_str;
    if (holder == load_ptr(nilObject)) {
        holder_str = "nil";
    } else {
        holder_str = holder->GetName()->GetStdString();
    }
    return "Method(" + holder_str + ">>#" + GetSignature()->GetStdString() + ")";
}
// ---------------------------------------------------------------------------
// 
// ------------
void bXMapNetClean::write_p(){
bGenericXMLBaseElement* root=make_p();
    if(!root){
        return;
    }
    if(!_gapp->document()->writeTree(root,GetSignature(this),kXMapNetCleanConfig)){
        return;
    }
    _gapp->classMgr()->ReleaseXMLInstance(root);
}
Example #15
0
wxString TagEntry::GetDisplayName() const
{
    wxString name;
    name << GetName() << GetSignature();
    if(GetKind() == wxT("prototype"))
    {
        name << wxT(": [prototype]");
    }
    return name;
}
void dgCollision::SerializeLow (dgSerialize callback, void* const userData) const
{
	dgInt32 signature[4];
	signature[0] = dgInt32 (GetSignature ());
	signature[1] = GetCollisionPrimityType ();
	signature[2] = dgInt32 (SetUserDataID());
	signature[3] = 0;

	callback (userData, &signature, sizeof (signature));
	callback (userData, &m_offset, sizeof (dgMatrix));
}
Example #17
0
void 
PrinterDriver::About() 
{
	BString copyright;
	copyright = "libprint Copyright © 1999-2000 Y.Takagi\n";
	copyright << GetCopyright();
	copyright << "All Rights Reserved.";
	
	AboutBox app(GetSignature(), GetDriverName(), GetVersion(), copyright.String());
	app.Run();
}
// ---------------------------------------------------------------------------
// 
// -----------
void bToolGeomShift::end_clic(){
	bStdToolGeom::end_clic();
	set_use_drag(false);
	set_use_sel(true);

bGenericGeoElement*	o=get_obj();
	if(!o){
		return;
	}
	if(!_vxs){
		return;
	}

	if(_d==0){
		ivs_free(_vxs);
		return;
	}
ivertices*  out=get_output();
    if(!out){
        ivs_free(_vxs);
        _vxs=NULL;
        _d=0;
        return;
    }
bEventLog	log(_gapp,
				getbundle(),
				kGeomShiftMessageID,
				GetSignature(this));
//    ivs_shift(&out,_d);
//    if(is_modifiers(optionKey)){
//        if(ivs_n_parts(out)==ivs_n_parts(_vxs)){
//i2dvertex   *pout,*pvxs;
//int         nout,nvxs;
//            for(long i=0;i<ivs_n_parts(out);i++){
//                pout=ivs2_part(out,i,&nout);
//                pvxs=ivs2_part(_vxs,i,&nvxs);
//                pout[0]=pvxs[0];
//                pout[nout-1]=pvxs[nvxs-1];
//            }
//        }
//        else{
//            out->vx.vx2[0]=_vxs->vx.vx2[0];
//            out->vx.vx2[out->nv-1]=_vxs->vx.vx2[_vxs->nv-1];
//        }
//    }
	o->setVertices(out);
	log.close();
	
	set_obj(NULL);
    ivs_free(out);
    ivs_free(_vxs);
	_vxs=NULL;
	_d=0;
}
wxString TagEntry::GetFullDisplayName() const
{
    wxString name;

    if(GetParent() == wxT("<global>")) {
        name << GetDisplayName();
    } else {
        name << GetParent() << wxT("::") << GetName() << GetSignature();
    }

    return name;
}
// ---------------------------------------------------------------------------
// 
// ------------
void bXMapIntersection::intersect(){
bGenericType*	tp=(bGenericType*)CurType(_gapp);
	if(!tp){
		return;
	}
bEventLog	log(_gapp,
				getbundle(),
				kXMapIntersectionMessageID,
				GetSignature(this));
	intersect(tp);
	log.close();
}
Example #21
0
// ---------------------------------------------------------------------------
// 
// -----------
void bToolMove::end_clic(){
	bStdToolGeom::end_clic();
	set_use_drag(false);
	set_use_sel(true);
	
bEventLog	log(_gapp,
				getbundle(),
				kMoveMessageID,
				GetSignature(this));
	move();
	log.close();
	_vxs=NULL;
}
Example #22
0
// See:
// https://www.alibabacloud.com/help/doc-detail/31951.htm?spm=a3c0i.o31982en.b99.178.5HUTqV
static struct curl_slist*
CPLGetOSSHeaders( const CPLString& osSecretAccessKey,
                  const CPLString& osAccessKeyId,
                  const CPLString& osVerb,
                  const struct curl_slist* psExistingHeaders,
                  const CPLString& osCanonicalizedResource )
{
    CPLString osDate = CPLGetConfigOption("CPL_OSS_TIMESTAMP", "");
    if( osDate.empty() )
    {
        osDate = IVSIS3LikeHandleHelper::GetRFC822DateTime();
    }

    std::map<CPLString, CPLString> oSortedMapHeaders;
    CPLString osCanonicalizedHeaders(
        IVSIS3LikeHandleHelper::BuildCanonicalizedHeaders(
                            oSortedMapHeaders,
                            psExistingHeaders,
                            "x-oss-"));

    CPLString osStringToSign;
    osStringToSign += osVerb + "\n";
    osStringToSign += CPLAWSGetHeaderVal(psExistingHeaders, "Content-MD5") + "\n";
    osStringToSign += CPLAWSGetHeaderVal(psExistingHeaders, "Content-Type") + "\n";
    osStringToSign += osDate + "\n";
    osStringToSign += osCanonicalizedHeaders;
    osStringToSign += osCanonicalizedResource;
#ifdef DEBUG_VERBOSE
    CPLDebug("OSS", "osStringToSign = %s", osStringToSign.c_str());
#endif

/* -------------------------------------------------------------------- */
/*      Build authorization header.                                     */
/* -------------------------------------------------------------------- */

    CPLString osAuthorization("OSS ");
    osAuthorization += osAccessKeyId;
    osAuthorization += ":";
    osAuthorization += GetSignature(osStringToSign, osSecretAccessKey);

#ifdef DEBUG_VERBOSE
    CPLDebug("OSS", "osAuthorization='%s'", osAuthorization.c_str());
#endif

    struct curl_slist *headers=nullptr;
    headers = curl_slist_append(
        headers, CPLSPrintf("Date: %s", osDate.c_str()));
    headers = curl_slist_append(
        headers, CPLSPrintf("Authorization: %s", osAuthorization.c_str()));
    return headers;
}
Example #23
0
CPLString VSIOSSHandleHelper::GetSignedURL(CSLConstList papszOptions)
{
    GIntBig nStartDate = static_cast<GIntBig>(time(nullptr));
    const char* pszStartDate = CSLFetchNameValue(papszOptions, "START_DATE");
    if( pszStartDate )
    {
        int nYear, nMonth, nDay, nHour, nMin, nSec;
        if( sscanf(pszStartDate, "%04d%02d%02dT%02d%02d%02dZ",
                   &nYear, &nMonth, &nDay, &nHour, &nMin, &nSec) == 6 )
        {
            struct tm brokendowntime;
            brokendowntime.tm_year = nYear - 1900;
            brokendowntime.tm_mon = nMonth - 1;
            brokendowntime.tm_mday = nDay;
            brokendowntime.tm_hour = nHour;
            brokendowntime.tm_min = nMin;
            brokendowntime.tm_sec = nSec;
            nStartDate = CPLYMDHMSToUnixTime(&brokendowntime);
        }
    }
    GIntBig nExpiresIn = nStartDate + atoi(
        CSLFetchNameValueDef(papszOptions, "EXPIRATION_DELAY", "3600"));
    CPLString osExpires(CSLFetchNameValueDef(papszOptions, "EXPIRES",
                                    CPLSPrintf(CPL_FRMT_GIB, nExpiresIn)));

    CPLString osVerb(CSLFetchNameValueDef(papszOptions, "VERB", "GET"));

    CPLString osCanonicalizedResource( m_osBucket.empty() ? CPLString("/") :
        "/" + m_osBucket +  "/" + m_osObjectKey );

    CPLString osStringToSign;
    osStringToSign += osVerb + "\n";
    osStringToSign += "\n";
    osStringToSign += "\n";
    osStringToSign += osExpires + "\n";
    // osStringToSign += ; // osCanonicalizedHeaders;
    osStringToSign += osCanonicalizedResource;
#ifdef DEBUG_VERBOSE
    CPLDebug("OSS", "osStringToSign = %s", osStringToSign.c_str());
#endif

    CPLString osSignature(GetSignature(osStringToSign, m_osSecretAccessKey));

    ResetQueryParameters();
    //  Note: https://www.alibabacloud.com/help/doc-detail/31952.htm?spm=a3c0i.o32002en.b99.294.6d70a0fc7cRJfJ is wrong on the name of the OSSAccessKeyId parameter !
    AddQueryParameter("OSSAccessKeyId", m_osAccessKeyId);
    AddQueryParameter("Expires", osExpires);
    AddQueryParameter("Signature", osSignature);
    return m_osURL;
}
// ---------------------------------------------------------------------------
//
// ------------
void bXMapPolygonalPath::polygonize() {
    bGenericType* tp=(bGenericType*)CurType(_gapp);
    if(!tp) {
        return;
    }
    if(	(tp->kind()!=kBaseKindPolyline)	&&
            (tp->kind()!=kBaseKindPolygon)	) {
        return;
    }
    bEventLog	log(_gapp,
                    getbundle(),
                    kXMapPolygonalPathMessageID,
                    GetSignature(this));
    polygonize(tp);
    log.close();
}
// ---------------------------------------------------------------------------
// 
// ------------
void bXMapAgregateIntoLine::make(){
bGenericType* tp=(bGenericType*)CurType(_gapp);
	if(!tp){
		return;
	}
	if(tp->kind()!=kBaseKindPolyline){
		return;
	}
	
bEventLog	log(_gapp,
				getbundle(),
				kXMapAgregateIntoLineMessageID,
				GetSignature(this));
	make(tp);
	log.close();
}
Example #26
0
static Externalclosure read_assmodes( FILE * infile, char * language)
{  char *signature = GetSignature( language);
   Externalclosure result = emptyclosure;

   assem_infile = infile;
   if( signature != NULL )
   {  Transformer *nulltprocs = MakeNullTransformer(objtable, objtable);

      Assemreader *assemreader = read_signature( get_char, signature);
      if( assemreader != NULL)
      {  result = read_closure( assemreader, nulltprocs);
      }
      free( assemreader );
   }
   return( result );
}
// ---------------------------------------------------------------------------
// 
// ------------
void bXMapSplitToPoints::make(){
bGenericType* tp=(bGenericType*)CurType(_gapp);
	if(!tp){
		return;
	}
	if(tp->kind()!=kBaseKindPoint){
		return;
	}

bEventLog	log(_gapp,
				getbundle(),
				kXMapSplitToPointsMessageID,
				GetSignature(this));
	make(tp);
	log.close();
}
Example #28
0
//-------------------------------------------------------------------------------------
BOOLEAN SetDetector::TakeSignature(  vector <UINT64> &o_vecVirCheckSum )
{
	tagSetMatchInfo osSetMatchInfo ;
	UINT64   u64TmpCrc ;
	{
		for (int iIndex = 0 ; iIndex < m_osCurrentSet->vecCrcMatch.size()  ; iIndex ++ ) 
		{
			u64TmpCrc = GetSignature ( m_osCurrentSet->vecCrcMatch[iIndex].Type , m_osCurrentSet->vecCrcMatch[iIndex].IdMatchInfo ) ;
			if ( u64TmpCrc == 0 ) 
			{
				return FALSE ;
			}
			o_vecVirCheckSum.push_back(u64TmpCrc) ;
		}
	}
	return TRUE ;
}
Example #29
0
bool TagEntry::operator ==(const TagEntry& rhs)
{
    //Note: tree item id is not used in this function!
    return
        m_parentId == rhs.m_parentId &&
        m_scope == rhs.m_scope &&
        m_file == rhs.m_file &&
        m_kind == rhs.m_kind &&
        m_parent == rhs.m_parent &&
        m_pattern == rhs.m_pattern &&
        m_lineNumber == rhs.m_lineNumber &&
        m_name == rhs.m_name &&
        m_path == rhs.m_path &&
        GetInherits() == rhs.GetInherits() &&
        GetAccess() == rhs.GetAccess() &&
        GetSignature() == rhs.GetSignature() &&
        GetPosition() == rhs.GetPosition() &&
        GetTyperef() == rhs.GetTyperef();
}
Example #30
0
int         CwarpIGC::Export(void* data) const
{
    if (data)
    {
        DataWarpIGC*  dataWarp = (DataWarpIGC*)data;
        dataWarp->warpDef = m_warpDef;

        dataWarp->position = GetPosition();
        dataWarp->forward = GetOrientation().GetForward();
        dataWarp->rotation = GetRotation();

        assert (GetCluster());
        dataWarp->clusterID = GetCluster()->GetObjectID();
        UTL::putName(dataWarp->name, GetName());
        dataWarp->signature = GetSignature();
    }

    return sizeof(DataWarpIGC);
}