Ejemplo n.º 1
0
bool wxRegKey::Copy(wxRegKey& keyDst)
{
    bool ok = true;

    // copy all sub keys to the new location
    wxString strKey;
    long lIndex;
    bool bCont = GetFirstKey(strKey, lIndex);
    while ( ok && bCont ) {
        wxRegKey key(*this, strKey);
        wxString keyName;
        keyName << GetFullName(&keyDst) << REG_SEPARATOR << strKey;
        ok = key.Copy(keyName);

        if ( ok )
            bCont = GetNextKey(strKey, lIndex);
        else
            wxLogError(_("Failed to copy the registry subkey '%s' to '%s'."),
                   GetFullName(&key), keyName.c_str());

    }

    // copy all values
    wxString strVal;
    bCont = GetFirstValue(strVal, lIndex);
    while ( ok && bCont ) {
        ok = CopyValue(strVal, keyDst);

        if ( !ok ) {
            wxLogSysError(m_dwLastError,
                          _("Failed to copy registry value '%s'"),
                          strVal.c_str());
        }
        else {
            bCont = GetNextValue(strVal, lIndex);
        }
    }

    if ( !ok ) {
        wxLogError(_("Failed to copy the contents of registry key '%s' to '%s'."),
                   GetFullName(this), GetFullName(&keyDst));
    }

    return ok;
}
Ejemplo n.º 2
0
 void PostTypeLoadException(LPCUTF8 pNameSpace, LPCUTF8 pTypeName, LPCUTF8 pMethodName,
                            UINT resIDWhy, OBJECTREF *pThrowable)
 {
     LPCWSTR wszFullName = NULL;
     GetFullName(&wszFullName); // ignore return hr
     
     ::PostTypeLoadException(pNameSpace, pTypeName, wszFullName,
                             pMethodName, resIDWhy, pThrowable);
 }
Ejemplo n.º 3
0
wxString PHPEntityClass::FormatPhpDoc() const
{
    wxString doc;
    doc << "/**\n"
        << " * @class " << GetFullName() << "\n"
        << " * @brief \n"
        << " */";
    return doc;
}
Ejemplo n.º 4
0
static bool Cmd_GetLastTransactionItem_Execute(COMMAND_ARGS)
{
	TESForm* form = NULL;
	GetLastTransactionInfo(&form, NULL);
	UInt32* refResult = (UInt32*)result;
	*refResult = form ? form->refID : 0;
	DEBUG_PRINT("GetLastTransactionItem >> %s", GetFullName(form));
	return true;
}
Ejemplo n.º 5
0
bool ldl_datablock::ContstructFullName(
		char *szName,
		ldl_datablock *dbParent,
		char *result )
{
	GetFullName(result);

	return true;
}
Ejemplo n.º 6
0
wxString PHPEntityClass::FormatPhpDoc(const CommentConfigData& data) const
{
    wxString doc;
    doc << data.GetCommentBlockPrefix() << "\n"
        << " * @class " << GetFullName() << "\n"
        << " * @brief \n"
        << " */";
    return doc;
}
Ejemplo n.º 7
0
// ----------------------------------------------------------------------------
// delete keys/values
// ----------------------------------------------------------------------------
bool wxRegKey::DeleteSelf()
{
  {
    wxLogNull nolog;
    if ( !Open() ) {
      // it already doesn't exist - ok!
      return true;
    }
  }

  // prevent a buggy program from erasing one of the root registry keys or an
  // immediate subkey (i.e. one which doesn't have '\\' inside) of any other
  // key except HKCR (HKCR has some "deleteable" subkeys)
  if ( m_strKey.empty() ||
       ((m_hRootKey != (WXHKEY) aStdKeys[HKCR].hkey) &&
        (m_strKey.Find(REG_SEPARATOR) == wxNOT_FOUND)) ) {
      wxLogError(_("Registry key '%s' is needed for normal system operation,\ndeleting it will leave your system in unusable state:\noperation aborted."),
                 GetFullName(this));

      return false;
  }

  // we can't delete keys while enumerating because it confuses GetNextKey, so
  // we first save the key names and then delete them all
  wxArrayString astrSubkeys;

  wxString strKey;
  long lIndex;
  bool bCont = GetFirstKey(strKey, lIndex);
  while ( bCont ) {
    astrSubkeys.Add(strKey);

    bCont = GetNextKey(strKey, lIndex);
  }

  size_t nKeyCount = astrSubkeys.Count();
  for ( size_t nKey = 0; nKey < nKeyCount; nKey++ ) {
    wxRegKey key(*this, astrSubkeys[nKey]);
    if ( !key.DeleteSelf() )
      return false;
  }

  // now delete this key itself
  Close();

  m_dwLastError = RegDeleteKey((HKEY) m_hRootKey, m_strKey.t_str());
  // deleting a key which doesn't exist is not considered an error
  if ( m_dwLastError != ERROR_SUCCESS &&
          m_dwLastError != ERROR_FILE_NOT_FOUND ) {
    wxLogSysError(m_dwLastError, _("Can't delete key '%s'"),
                  GetName().c_str());
    return false;
  }

  return true;
}
Ejemplo n.º 8
0
VPackage* VMemberBase::GetPackage() const
{
    guard(VMemberBase::GetPackage);
    for (const VMemberBase* p = this; p; p = p->Outer)
        if (p->MemberType == MEMBER_Package)
            return (VPackage*)p;
    Sys_Error("Member object %s not in a package", *GetFullName());
    return NULL;
    unguard;
}
Ejemplo n.º 9
0
void PHPEntityNamespace::PrintStdout(int indent) const
{
    wxString indentString(' ', indent);
    wxPrintf("%sNamespace name: %s\n", indentString, GetFullName());

    PHPEntityBase::List_t::const_iterator iter = m_children.begin();
    for(; iter != m_children.end(); ++iter) {
        (*iter)->PrintStdout(indent + 4);
    }
}
void AAmbitionOfNobunagaPlayerController::ServerClearHeroAction_Implementation(AHeroCharacter* hero,
        const FHeroAction& action)
{
	if (Role < ROLE_Authority)
	{
		UE_LOG(LogAmbitionOfNobunaga, Log, TEXT("%s ClearHeroAction"), *GetFullName());
		AAONGameState* ags = Cast<AAONGameState>(UGameplayStatics::GetGameState(GetWorld()));
		ags->ClearHeroAction(hero, action);
	}
}
void AAmbitionOfNobunagaPlayerController::ServerHeroUseSkill_Implementation(AHeroCharacter* hero, int32 index,
        const FVector& VFaceTo, const FVector& Pos)
{
	if (Role == ROLE_Authority)
	{
		UE_LOG(LogAmbitionOfNobunaga, Log, TEXT("%s HeroUseSkill"), *GetFullName());
		AAONGameState* ags = Cast<AAONGameState>(UGameplayStatics::GetGameState(GetWorld()));
		ags->HeroUseSkill(hero, index, VFaceTo, Pos);
	}
}
Ejemplo n.º 12
0
Archivo: Client.cpp Proyecto: ex0a/znc
void CClient::ReadLine(const CString& sData) {
	CString sLine = sData;

	sLine.TrimRight("\n\r");

	DEBUG("(" << GetFullName() << ") CLI -> ZNC [" << sLine << "]");

	if (IsAttached()) {
		NETWORKMODULECALL(OnUserRaw(sLine), m_pUser, m_pNetwork, this, return);
	} else {
Ejemplo n.º 13
0
void PHPEntityNamespace::Store(PHPLookupTable* lookup)
{
    try {
        // A namespace, unlike other PHP entities, can be defined in various files
        // and in multiple locations. This means, that by definition, there can be multiple entries
        // for the same namespace, however, since our relations in the database is ID based,
        // we try to locate the namespace in the DB before we attempt to insert it
        wxSQLite3Database& db = lookup->Database();
        {
            wxSQLite3Statement statement =
                db.PrepareStatement("SELECT * FROM SCOPE_TABLE WHERE FULLNAME=:FULLNAME LIMIT 1");
            statement.Bind(statement.GetParamIndex(":FULLNAME"), GetFullName());
            wxSQLite3ResultSet res = statement.ExecuteQuery();
            if(res.NextRow()) {
                // we have a match, update this item database ID to match
                // what we have found in the database
                PHPEntityNamespace ns;
                ns.FromResultSet(res);
                SetDbId(ns.GetDbId());
                return;
            }
        }

        // Get the 'parent' namespace part
        wxString parentPath = GetFullName().BeforeLast('\\');
        DoEnsureNamespacePathExists(db, parentPath);

        {
            wxSQLite3Statement statement = db.PrepareStatement(
                "INSERT INTO SCOPE_TABLE (ID, SCOPE_TYPE, SCOPE_ID, NAME, FULLNAME, LINE_NUMBER, FILE_NAME) "
                "VALUES (NULL, 0, -1, :NAME, :FULLNAME, :LINE_NUMBER, :FILE_NAME)");
            statement.Bind(statement.GetParamIndex(":NAME"), GetShortName());
            statement.Bind(statement.GetParamIndex(":FULLNAME"), GetFullName());
            statement.Bind(statement.GetParamIndex(":LINE_NUMBER"), GetLine());
            statement.Bind(statement.GetParamIndex(":FILE_NAME"), GetFilename().GetFullPath());
            statement.ExecuteUpdate();
            SetDbId(db.GetLastRowId());
        }
    } catch(wxSQLite3Exception& exc) {
        wxUnusedVar(exc);
    }
}
Ejemplo n.º 14
0
void UActorComponent::ExecuteRegisterEvents()
{
	if(!bRegistered)
	{
		OnRegister();
		checkf(bRegistered, TEXT("Failed to route OnRegister (%s)"), *GetFullName());
	}

	if(FApp::CanEverRender() && !bRenderStateCreated && World->Scene)
	{
		CreateRenderState_Concurrent();
		checkf(bRenderStateCreated, TEXT("Failed to route CreateRenderState_Concurrent (%s)"), *GetFullName());
	}

	if(!bPhysicsStateCreated && World->GetPhysicsScene() && ShouldCreatePhysicsState())
	{
		CreatePhysicsState();
		checkf(bPhysicsStateCreated, TEXT("Failed to route CreatePhysicsState (%s)"), *GetFullName());
	}
}
Ejemplo n.º 15
0
void CPDF_InterForm::GetAllFieldNames(CFX_WideStringArray& allFieldNames) {
  allFieldNames.RemoveAll();
  int nCount = m_pFieldTree->m_Root.CountFields();
  for (int i = 0; i < nCount; i++) {
    CPDF_FormField* pField = m_pFieldTree->m_Root.GetField(i);
    if (pField) {
      CFX_WideString full_name = GetFullName(pField->GetFieldDict());
      allFieldNames.Add(full_name);
    }
  }
}
void LimitDecrementerBody::operator() (const Body::InputType1& input, Node::MultiNodeContinueType::output_ports_type& output)
{
    imageWrapperIn_ = dynamic_cast<ImageMessage*>(input);
    TRACE(GetFullName() + ": " + imageWrapperIn_->GetMetaData().GetFrameNumber());

    BeforeProcess();
    Process();
    AfterProcess();

    std::get<OUTPUT_LIMITER>(output).try_put(tbb::flow::continue_msg());
}
Ejemplo n.º 17
0
LONG 
HookRegQueryValueEx( 
    HKEY hkey, 
    PCHAR lpszValueName, 
    PDWORD lpdwReserved, 
    PDWORD lpdwType, 
    PBYTE lpbData, 
    PDWORD lpcbData 
    ) 
{
    LONG      retval;
    int       i, len;
    CHAR      fullname[NAMELEN], data[DATASIZE], tmp[2*BINARYLEN], process[PROCESSLEN];
  
    GetFullName( hkey, NULL, lpszValueName, fullname );
    retval = RealRegQueryValueEx( hkey, lpszValueName, lpdwReserved, 
                                  lpdwType, lpbData, lpcbData );
    data[0] = 0;
    if( retval == ERROR_SUCCESS && lpbData ) {

        if( !lpdwType || *lpdwType == REG_BINARY ) {

            if( *lpcbData > BINARYLEN ) len = BINARYLEN;
            else len = *lpcbData;

            for( i = 0; i < len; i++ ) {

                sprintf( tmp, "%X ", lpbData[i]);
                strcat( data, tmp );
            }

            if( *lpcbData > BINARYLEN) strcat( data, "...");

        } else if( *lpdwType == REG_SZ ) {

            strcpy( data, "\"");
            strncat( data, lpbData, STRINGLEN );
            if( strlen( lpbData ) > STRINGLEN ) 
                strcat( data, "..." );
            strcat( data, "\"");

        } else if( *lpdwType == REG_DWORD ) {

            sprintf( data, "0x%X", *(PDWORD) lpbData );
        }
    } 

    if( ErrorString( retval ) &&  FilterDef.logreads) {

        LogRecord( "%s\tQueryValueEx\t%s\t%s\t%s", 
                   GetProcess( process ), fullname, ErrorString( retval ), data);  
    }
    return retval;
}
Ejemplo n.º 18
0
void ConfigGroup::Rename(const wxString& newName)
{
    m_strName = newName;

    LineList *line = GetGroupLine();
    wxString strFullName;
    strFullName << wxT("[") << (GetFullName().c_str() + 1) << wxT("]"); // +1: no '/'
    line->SetText(strFullName);

    SetDirty();
}
Ejemplo n.º 19
0
bool Cmd_GetBaseObject_Execute(COMMAND_ARGS)
{
	UInt32* refResult = (UInt32*)result;
	*refResult = 0;

	if (thisObj && thisObj->baseForm) {
		*refResult = thisObj->baseForm->refID;
		if (IsConsoleMode())
			Console_Print("GetBaseObject >> %08x (%s)", thisObj->baseForm->refID, GetFullName(thisObj->baseForm));
	}
	return true;
}
Ejemplo n.º 20
0
void UEdGraph::GetAllChildrenGraphs(TArray<UEdGraph*>& Graphs) const
{
#if WITH_EDITORONLY_DATA
	for (int32 i = 0; i < SubGraphs.Num(); ++i)
	{
		UEdGraph* Graph = SubGraphs[i];
		checkf(Graph, *FString::Printf(TEXT("%s has invalid SubGraph array entry at %d"), *GetFullName(), i));
		Graphs.Add(Graph);
		Graph->GetAllChildrenGraphs(Graphs);
	}
#endif // WITH_EDITORONLY_DATA
}
Ejemplo n.º 21
0
void UClassProperty::CheckValidObject(void* Value) const
{
#if WITH_EDITOR
	// Ugly hack to replace Blueprint references with Class references.

	struct FReplaceBlueprintWithClassHelper
	{
		bool bShouldReplace;
		UClass* BlueprintClass;
		UClassProperty* BPGeneratedClassProp;

		FReplaceBlueprintWithClassHelper() : bShouldReplace(false), BlueprintClass(NULL), BPGeneratedClassProp(NULL)
		{
			GConfig->GetBool(TEXT("EditoronlyBP"), TEXT("bReplaceBlueprintWithClass"), bShouldReplace, GEditorIni);
			if (bShouldReplace)
			{
				BlueprintClass = FindObject<UClass>(NULL, TEXT("/Script/Engine.Blueprint"));
				ensure(BlueprintClass);
				BPGeneratedClassProp = BlueprintClass ? FindField<UClassProperty>(BlueprintClass, TEXT("GeneratedClass")) : NULL;
				ensure(BPGeneratedClassProp);
			}
		}

		bool CanReplace() const
		{
			return bShouldReplace && BlueprintClass && BPGeneratedClassProp;
		}
	};
	static FReplaceBlueprintWithClassHelper Helper;

	const UObject* Object = GetObjectPropertyValue(Value);
	Super::CheckValidObject(Value);
	const UObject* CurrentObject = GetObjectPropertyValue(Value);

	if (Helper.CanReplace()
		&& !CurrentObject
		&& Object 
		&& Object->IsA(Helper.BlueprintClass)
		&& (UObject::StaticClass() == MetaClass))
	{
		UObject* RecoveredObject = Helper.BPGeneratedClassProp->GetPropertyValue_InContainer(Object);
		SetObjectPropertyValue(Value, RecoveredObject);
		UE_LOG(LogProperty, Log,
			TEXT("Blueprint '%s' is replaced with class '%s' in property '%s'"),
			*Object->GetFullName(),
			*RecoveredObject->GetFullName(),
			*GetFullName());
	}
#else	// WITH_EDITOR
	Super::CheckValidObject(Value);
#endif	// WITH_EDITOR
}
Ejemplo n.º 22
0
bool Cmd_GetBaseForm_Execute(COMMAND_ARGS)	// For LeveledForm, find real baseForm, not temporary one
{
	UInt32* refResult = (UInt32*)result;
	*refResult = 0;
	TESForm* baseForm = GetPermanentBaseForm(thisObj);

	if (baseForm) {
		*refResult = baseForm->refID;
		if (IsConsoleMode())
			Console_Print("GetBaseForm >> %08x (%s)", baseForm->refID, GetFullName(baseForm));
	}
	return true;
}
Ejemplo n.º 23
0
void UActorComponent::ExecuteUnregisterEvents()
{
	if(bPhysicsStateCreated)
	{
		check(bRegistered); // should not have physics state unless we are registered
		DestroyPhysicsState();
		checkf(!bPhysicsStateCreated, TEXT("Failed to route DestroyPhysicsState (%s)"), *GetFullName());
	}

	if(bRenderStateCreated)
	{
		check(bRegistered);
		DestroyRenderState_Concurrent();
		checkf(!bRenderStateCreated, TEXT("Failed to route DestroyRenderState_Concurrent (%s)"), *GetFullName());
	}

	if(bRegistered)
	{
		OnUnregister();
		checkf(!bRegistered, TEXT("Failed to route OnUnregister (%s)"), *GetFullName());
	}
}
Ejemplo n.º 24
0
void
CMVarNode::UpdateContent()
{
	assert( itsIsPointerFlag );

	delete itsContentCommand;

	const JString expr = GetFullName();
	itsContentCommand = (CMGetLink())->CreateVarContentCommand(expr);
	ListenTo(itsContentCommand);

	itsContentCommand->CMCommand::Send();
}
Ejemplo n.º 25
0
void CRUTbl::ReleaseReadProtectedOpen()
{
	RUASSERT(TRUE == isRPOpenPending_);

#ifdef _DEBUG
	CDSString msg("UnLocking table " + GetFullName() + "\n");
	
	CRUGlobals::GetInstance()->
		LogDebugMessage(CRUGlobals::DUMP_LOCKS, "", msg, TRUE);
#endif

	isRPOpenPending_ = FALSE;
}
Ejemplo n.º 26
0
JBoolean
CBCClass::ViewDeclaration
	(
	const JCharacter*	fnName,
	const JBoolean		caseSensitive,
	const JBoolean		reportNotFound
	)
	const
{
	JBoolean found = kJFalse;

	JString headerName;
	if (!Implements(fnName, caseSensitive))
		{
		found = ViewInheritedDeclaration(fnName, caseSensitive, reportNotFound);
		if (!found && reportNotFound)
			{
			JString msg = "Unable to find any declaration for \"";
			msg += fnName;
			msg += "\".";
			(JGetUserNotification())->ReportError(msg);
			}
		}
	else if (GetFileName(&headerName))
		{
		CBDocumentManager* docMgr = CBGetDocumentManager();

		JIndex lineIndex;
		if (docMgr->SearchFile(headerName, fnName, caseSensitive, &lineIndex))
			{
			docMgr->OpenTextDocument(headerName, lineIndex);
			found = kJTrue;
			}
		else if (reportNotFound)
			{
			JString msg = "Unable to find the declaration of \"";
			msg += fnName;
			msg += "\".";
			(JGetUserNotification())->ReportError(msg);
			}
		}
	else if (reportNotFound)
		{
		JString msg = GetFullName();
		msg.PrependCharacter('"');
		msg += "\" is a ghost class, so no information is available for it.";
		(JGetUserNotification())->ReportError(msg);
		}

	return found;
}
Ejemplo n.º 27
0
bool wxRegKey::SetValue(const wxString& szValue, long lValue)
{
  if ( CONST_CAST Open() ) {
    m_dwLastError = RegSetValueEx((HKEY) m_hKey, RegValueStr(szValue),
                                  (DWORD) RESERVED, REG_DWORD,
                                  (RegString)&lValue, sizeof(lValue));
    if ( m_dwLastError == ERROR_SUCCESS )
      return true;
  }

  wxLogSysError(m_dwLastError, _("Can't set value of '%s'"),
                GetFullName(this, szValue));
  return false;
}
Ejemplo n.º 28
0
static bool Cmd_GetPCLastDroppedItem_Execute(COMMAND_ARGS)
{
	UInt32* refResult = (UInt32*)result;
	*refResult = 0;

	TESForm* form = GetPCLastDroppedItem();
	if (form)
		*refResult = form->refID;

	if (IsConsoleMode())
		Console_Print("GetPCLastDroppedItem >> %08X (%s)", *refResult, GetFullName(form));

	return true;
}
Ejemplo n.º 29
0
void
CBFileNode::OpenFile()
	const
{
	JString fullName;
	if (GetFullName(&fullName))
		{
		(CBGetDocumentManager())->OpenSomething(fullName);
		}
	else
		{
		ReportNotFound();
		}
}
Ejemplo n.º 30
0
static bool GetQuantityMenuInfo_Execute(COMMAND_ARGS, UInt32 which)
{
	QuantityMenu* menu = (QuantityMenu*)GetMenuByType(kMenuType_Quantity);
	if (menu) {
		switch (which) {
			case kQuantityMenu_Max:
				*result = menu->maxQuantity;
				DEBUG_PRINT("GetQMMaximum >> %d", menu->maxQuantity);
				return true;
			case kQuantityMenu_Cur:
				{
					if (menu->quantity_scroll) {
						Tile::Value* val = menu->quantity_scroll->GetValueByType(kTileValue_user7);
						if (val) {
							*result = val->num;
							DEBUG_PRINT("GetQMCurrent >> %.0f", val->num);
						}
					}
				}
				return true;
			case kQuantityMenu_Item:
				{
					TESForm* item = NULL;
					UInt32* refResult = (UInt32*)result;
					*refResult = 0;

					if (menu->itemTile) {
						Tile::Value* val = menu->itemTile->GetValueByType(kTileValue_user11);
						if (val) {
							UInt32 idx = val->num;
							// are we bartering? and what container is open?
							bool bMerchant = false;
							TESObjectREFR* container = *g_thePlayer;
							if (menu->unk44 == 0x33) {
								ContainerMenu* contMenu = (ContainerMenu*)GetMenuByType(kMenuType_Container);
								container = contMenu->isContainerContents ? contMenu->refr : container;
								bMerchant = contMenu && contMenu->isContainerContents && contMenu->isBarter;
							}

							item = container->GetInventoryItem(idx, bMerchant);
							*refResult = item ? item->refID : 0;
							DEBUG_PRINT("GetQMItem >> %s", GetFullName(item));
						}
					}
				}
				return true;
		}
	}
	return true;
}