Ejemplo n.º 1
0
void* SystemHeadersThread::Entry()
{
    wxArrayString dirs;
    {
        wxCriticalSectionLocker locker(*m_SystemHeadersThreadCS);
        for (size_t i=0; i<m_IncludeDirs.GetCount(); ++i)
        {
            if (m_SystemHeadersMap.find(m_IncludeDirs[i]) == m_SystemHeadersMap.end())
            {
                dirs.Add(m_IncludeDirs[i]);
                m_SystemHeadersMap[m_IncludeDirs[i]] = StringSet();
            }
        }
    }
    // collect header files in each dir, this is done by HeaderDirTraverser
    for (size_t i=0; i<dirs.GetCount(); ++i)
    {
        if ( TestDestroy() )
            break;

        // check the dir is ready for traversing
        wxDir dir(dirs[i]);
        if ( !dir.IsOpened() )
        {
            CodeBlocksThreadEvent evt(wxEVT_COMMAND_MENU_SELECTED, idSystemHeadersThreadError);
            evt.SetClientData(this);
            evt.SetString(wxString::Format(_T("SystemHeadersThread: Unable to open: %s"), dirs[i].wx_str()));
            wxPostEvent(m_Parent, evt);
            continue;
        }

        TRACE(_T("SystemHeadersThread: Launching dir traverser for: %s"), dirs[i].wx_str());

        HeaderDirTraverser traverser(this, m_SystemHeadersThreadCS, m_SystemHeadersMap, dirs[i]);
        dir.Traverse(traverser, wxEmptyString, wxDIR_FILES | wxDIR_DIRS);

        TRACE(_T("SystemHeadersThread: Dir traverser finished for: %s"), dirs[i].wx_str());

        if ( TestDestroy() )
            break;

        CodeBlocksThreadEvent evt(wxEVT_COMMAND_MENU_SELECTED, idSystemHeadersThreadUpdate);
        evt.SetClientData(this);
        evt.SetString(wxString::Format(_T("SystemHeadersThread: %s , %lu"), dirs[i].wx_str(), static_cast<unsigned long>(m_SystemHeadersMap[dirs[i]].size())));
        wxPostEvent(m_Parent, evt);
    }

    if ( !TestDestroy() )
    {
        CodeBlocksThreadEvent evt(wxEVT_COMMAND_MENU_SELECTED, idSystemHeadersThreadFinish);
        evt.SetClientData(this);
        if (!dirs.IsEmpty())
            evt.SetString(wxString::Format(_T("SystemHeadersThread: Total number of paths: %lu"), static_cast<unsigned long>(dirs.GetCount())));
        wxPostEvent(m_Parent, evt);
    }

    TRACE(_T("SystemHeadersThread: Done."));

    return NULL;
}
Ejemplo n.º 2
0
TString *USBStandardHubGetDeviceNames (TUSBDevice *pDevice)
{
	assert (pDevice != 0);

	TString *pResult = (TString *) malloc (sizeof (TString));
	assert (pResult != 0);
	String (pResult);

	for (unsigned nSelector = DeviceNameVendor; nSelector < DeviceNameUnknown; nSelector++)
	{
		TString *pName = USBDeviceGetName (pDevice, (TDeviceNameSelector) nSelector);
		assert (pName != 0);

		if (StringCompare (pName, "unknown") != 0)
		{
			if (StringGetLength (pResult) > 0)
			{
				StringAppend (pResult, ", ");
			}

			StringAppend (pResult, StringGet (pName));
		}

		_String (pName);
		free (pName);
	}

	if (StringGetLength (pResult) == 0)
	{
		StringSet (pResult, "unknown");
	}

	return pResult;
}
StringSet timeSeriesNames(const SqlFileTimeSeriesQueryVector& queries) {
  StringSet result;
  BOOST_FOREACH(const SqlFileTimeSeriesQuery& q,queries) {
    if (!q.vetted()) { return StringSet(); }
    OS_ASSERT(q.timeSeries().get().name());
    result.insert(*(q.timeSeries().get().name()));
  }
  return result;
}
Ejemplo n.º 4
0
const StringSet Switchboard::GetSubscriptionsFor(MessageListener* subscriber)
{
	if (_subscriptions.find(subscriber) == _subscriptions.end())
	{
		return StringSet();
	}
	else
	{
		return _subscriptions[subscriber];
	}
}
Ejemplo n.º 5
0
int wuFileSuffixSet( char *ftName, char *suffix, char *endName )
{
	int i;
	int len;
	int dotlen;
	char tempname[64];
	len = strlen(ftName);
	dotlen = 0;
	i = 0;
	while( i < len )
	{
		if(ftName[i] == '.')
		{
			dotlen = i;
			i = len;
		}
		else
		{
			dotlen = len;
		}
		i++;
	}
	//return dotlen;
	
	//some rad name sorting stuff
	if ( ftName[0] == '/' || ftName[0] == '\\' )
	{
		strcpy ( tempname, &ftName[1] );
		if ( ftName[dotlen] == '.' )
		{
			tempname[dotlen-1] = 0;
		}
	}
	else
	{
		strcpy ( tempname, ftName );
		if( ftName[dotlen] == '.' )
		{
			tempname[dotlen] = '\0';
		}
	}
	
	// replace all '\' with '/'
	for ( i = 0; tempname[i]; i++ )
	{
		if ( tempname[i] == '\\' )
		{
			tempname[i] = '/';
		}
	}
	StringSet( endName, "%s%s", tempname, suffix );
	return 0;
}
Ejemplo n.º 6
0
 GameConfig::GameConfig() :
 m_path(IO::Path("")),
 m_icon(IO::Path("")),
 m_fileSystemConfig(IO::Path(""), ""),
 m_textureConfig("", "", IO::Path(""), IO::Path("")),
 m_entityConfig(IO::Path(""), StringSet(), Color()) {}
 IvarDynamicState(const IvarDynamicState *rhs) :
 _assignPropertyWasCleared(rhs ? rhs->_assignPropertyWasCleared : StringSet()),
 _targetWasCleared(rhs ? rhs->_targetWasCleared : false),
 _observerWasCleared(rhs ? rhs->_observerWasCleared : false)
 { }
Ejemplo n.º 8
0
namespace Props {
const StringSet fillList = StringSet() << "fill" << "fill-rule" << "fill-opacity";
const StringSet strokeList = StringSet()
    << "stroke" << "stroke-width" << "stroke-linecap" << "stroke-linejoin" << "stroke-miterlimit"
    << "stroke-dasharray" << "stroke-dashoffset" << "stroke-opacity";

const StringSet presentationAttributes = StringSet()
    << "alignment-baseline" << "baseline-shift" << "clip-path" << "clip-rule" << "clip"
    << "color-interpolation-filters" << "color-interpolation" << "color-profile"
    << "color-rendering" << "color" << "cursor" << "direction" << "display" << "dominant-baseline"
    << "enable-background" << "fill-opacity" << "fill-rule" << "fill" << "filter" << "flood-color"
    << "flood-opacity" << "font-family" << "font-size-adjust" << "font-size" << "font-stretch"
    << "font-style" << "font-variant" << "font-weight" << "glyph-orientation-horizontal"
    << "glyph-orientation-vertical" << "image-rendering" << "kerning" << "letter-spacing"
    << "lighting-color" << "marker-end" << "marker-mid" << "marker-start" << "mask" << "opacity"
    << "overflow" << "pointer-events" << "shape-rendering" << "stop-color" << "stop-opacity"
    << "stroke-dasharray" << "stroke-dashoffset" << "stroke-linecap" << "stroke-linejoin"
    << "stroke-miterlimit" << "stroke-opacity" << "stroke-width" << "stroke" << "text-anchor"
    << "text-decoration" << "text-rendering" << "unicode-bidi" << "visibility" << "word-spacing"
    << "writing-mode";

const CharList linkableStyleAttributes = CharList()
    << "clip-path" << "fill" << "mask" << "filter" << "stroke" << "marker-start"
    << "marker-mid" << "marker-end";

const QStringList linearGradient = QStringList()
    << "gradientTransform" << "xlink:href" << "x1" << "y1" << "x2" << "y2"
    << "gradientUnits" << "spreadMethod" << "externalResourcesRequired";

const QStringList radialGradient = QStringList()
    << "gradientTransform" << "xlink:href" << "cx" << "cy" << "r" << "fx" << "fy"
    << "gradientUnits" << "spreadMethod" << "externalResourcesRequired";

const QStringList filter = QStringList()
    << "gradientTransform" << "xlink:href" << "x" << "y" << "width" << "height" << "filterRes"
    << "filterUnits" << "primitiveUnits" << "externalResourcesRequired";

const StringSet maskAttributes = StringSet()
    << "x" << "y" << "width" << "height"
    << "maskUnits" << "maskContentUnits" << "externalResourcesRequired";

const StringSet digitList = StringSet()
    << "x" << "y" << "x1" << "y1" << "x2" << "y2" << "width" << "height" << "r" << "rx" << "ry"
    << "fx" << "fy" << "cx" << "cy" << "dx" << "dy" << "offset";

const StringSet filterDigitList = StringSet()
    << "stdDeviation" << "baseFrequency" << "k" << "k1" << "k2" << "k3" << "specularConstant"
    << "dx" << "dy" << "stroke-dasharray";

const StringSet defsList = StringSet()
    << "altGlyphDef" << "clipPath" << "cursor" << "filter" << "linearGradient"
    << "marker" << "mask" << "pattern" << "radialGradient"/* << "symbol"*/;

const StringSet referencedElements = StringSet()
    << "a" << "altGlyphDef" << "clipPath" << "color-profile" << "cursor" << "filter" << "font"
    << "font-face" << "foreignObject" << "image" << "marker" << "mask" << "pattern" << "script"
    << "style" << "switch" << "text" << "view";

const StringSet textElements = StringSet()
    << "text" << "tspan" << "flowRoot" << "flowPara" << "flowSpan" << "textPath";

const StringSet textAttributes = StringSet()
    << "font-style" << "font-variant" << "font-weight" << "font-weight" << "font-stretch"
    << "font-size" << "font-size-adjust" << "kerning" << "letter-spacing" << "word-spacing"
    << "text-decoration" << "writing-mode" << "glyph-orientation-vertical"
    << "glyph-orientation-horizontal" << "direction" << "text-anchor" << "dominant-baseline"
    << "alignment-baseline" << "baseline-shift";
const QVariantHash defaultStyleValues = Tools::initDefaultStyleHash();

const StringSet svgElementList = StringSet()
    << "a" << "altGlyph" << "altGlyphDef" << "altGlyphItem" << "animate" << "animateColor"
    << "animateMotion" << "animateTransform" << "circle" << "clipPath" << "color-profile"
    << "cursor" << "defs" << "desc" << "ellipse" << "feBlend" << "feColorMatrix"
    << "feComponentTransfer" << "feComposite" << "feConvolveMatrix" << "feDiffuseLighting"
    << "feDisplacementMap" << "feDistantLight" << "feFlood" << "feFuncA" << "feFuncB" << "feFuncG"
    << "feFuncR" << "feGaussianBlur" << "feImage" << "feMerge" << "feMergeNode" << "feMorphology"
    << "feOffset" << "fePointLight" << "feSpecularLighting" << "feSpotLight" << "feTile"
    << "feTurbulence" << "filter" << "font" << "font-face" << "font-face-format" << "font-face-name"
    << "font-face-src" << "font-face-uri" << "foreignObject" << "g" << "glyph" << "glyphRef"
    << "hkern" << "image" << "line" << "linearGradient" << "marker" << "mask" << "metadata"
    << "missing-glyph" << "mpath" << "path" << "pattern" << "polygon" << "polyline"
    << "radialGradient" << "rect" << "script" << "set" << "stop" << "style" << "svg" << "switch"
    << "symbol" << "text" << "textPath" << "title" << "tref" << "flowRoot" << "flowRegion"
    << "flowPara" << "flowSpan" << "tspan" << "use" << "view" << "vkern";

const StringSet elementsUsingXLink = StringSet()
    << "a" << "altGlyph" << "color-profile" << "cursor" << "feImage" << "filter" << "font-face-uri"
    << "glyphRef" << "image" << "linearGradient" << "mpath" << "pattern" << "radialGradient"
    << "script" << "textPath" << "use" << "animate" << "animateColor" << "animateMotion"
    << "animateTransform" << "set" << "tref";

const StringSet containers = StringSet()
    << "a" << "defs" << "glyph" << "g" << "marker" /*<< "mask"*/ << "missing-glyph" /*<< "pattern"*/
    << "svg" << "switch" <<  "symbol";

const StringSet stopAttributes = StringSet()
    << "offset" << "stop-color" << "stop-opacity";

const StringSet lengthTypes = StringSet()
    << "em" << "ex" << "px" << "in" << "cm" << "mm" << "pt" << "pc";
}
Ejemplo n.º 9
0
DWORD ExecCreateProcess(const char* command_str, char** result)
{
    PROCESS_INFORMATION pi;
    STARTUPINFO si;
    //HANDLE hStdout;
    SECURITY_ATTRIBUTES sa;
    HANDLE hRead,hWrite;
    char buffer[4096] = {0};
    DWORD bytesRead;
    DWORD ExitCode = ERROR;
	char* runcmd;

    sa.nLength = sizeof(SECURITY_ATTRIBUTES);
    sa.lpSecurityDescriptor = NULL;
    sa.bInheritHandle = TRUE;
    if (!CreatePipe(&hRead,&hWrite,&sa,0))
	{
        printf("Error On CreatePipe()");
        return ERROR;
    }

	runcmd=StringInit();
	runcmd=StringSet(runcmd, command_str);
	//runcmd=StringInsert (runcmd,"c://windows//system32//cmd.exe /c ",0);

    //hStdout = GetStdHandle(STD_OUTPUT_HANDLE);

    ZeroMemory(&si, sizeof(si));
    si.cb = sizeof(si);
    si.wShowWindow = SW_SHOW;
    si.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
	si.hStdOutput = hWrite;
	si.hStdError = hWrite;

    if (CreateProcess(NULL, runcmd, NULL, NULL, TRUE, CREATE_NO_WINDOW, NULL, NULL, &si, &pi))
    {
		printf("Excuting \"%s\"\n", runcmd);
        WaitForSingleObject(pi.hProcess, INFINITE);
        GetExitCodeProcess(pi.hProcess, &ExitCode);
        CloseHandle(pi.hThread);
        CloseHandle(pi.hProcess);
    }
    else
    {
        //MessageBox(NULL, "The process could not be started...", NULL, MB_OK);
		printf("The process could not be started.\n");
		CloseHandle(hWrite);
		free(runcmd);
		return 0;
    }
    CloseHandle(hWrite);
	*result = StringInit();

    while (TRUE) 
    {
        if (ReadFile(hRead, buffer, 4095, &bytesRead, NULL) == FALSE)
        {
            break;
        }
		
		*result = StringAppent(*result, buffer);
		memset(buffer,0,4096);
		//printf(buffer);
    }

    return ExitCode;
}