Ejemplo n.º 1
0
void GuiOptions::setDefaultOptions()
{
    setNameValueBool(OptGuiShowAttributes, true);
    setNameValueBool(OptGuiShowOperations, true);
    setNameValueBool(OptGuiShowOperParams, true);
    setNameValueBool(OptGuiShowAttrTypes, true);
    setNameValueBool(OptGuiShowOperTypes, true);
    setNameValueBool(OptGuiShowPackageName, true);
    setNameValueBool(OptGuiShowOovSymbols, true);
    setNameValueBool(OptGuiShowTemplateRelations, true);
    setNameValueBool(OptGuiShowOperParamRelations, true);
    setNameValueBool(OptGuiShowOperBodyVarRelations, true);
    setNameValueBool(OptGuiShowRelationKey, true);

    setNameValueBool(OptGuiShowCompImplicitRelations, false);
    /*
    #ifdef __linux__
        setNameValue(OptEditorPath, "/usr/bin/gedit");
    #else
        setNameValue(OptEditorPath, "\\Windows\\notepad.exe");
    #endif
    */
#ifdef __linux__
    setNameValue(OptGuiEditorPath, "./oovEdit");
#else
    setNameValue(OptGuiEditorPath, "oovEdit.exe");
#endif
    setNameValue(OptGuiEditorLineArg, "+");
}
Ejemplo n.º 2
0
/// For every includer file that is run across during parsing, this means that
/// the includer file was fully parsed, and that no old included information
/// needs to be kept, except to check if the old included information has not
/// changed.
///
///  This code assumes that no tricks are played with ifdef values, and
/// ifdef values must be the same every time a the same file is included.
void IncDirDependencyMap::write()
    {
    bool anyChanges = false;
    time_t curTime;
    time_t changedTime = 0;
    time(&curTime);

#if(SHARED_FILE)
    SharedFile file;
    if(!writeFileExclusiveReadUpdate(file))
        {
        fprintf(stderr, "\nOovCppParser - Write file sharing error %s\n", getFilename().c_str());
        }
#endif
    // Append new values from parsed includes into the original NameValueFile.
    // Update existing values times and make new dependencies.
    for(const auto &newMapItem : mParsedIncludeDependencies)
        {
        bool changed = includedPathsChanged(newMapItem.first, newMapItem.second);
        if(changed)
            {
            // Cheat and say updated time and checked time are the same.
            changedTime = curTime;

            CompoundValue newIncludedInfoCompVal;
            OovString changeStr;
            changeStr.appendInt(changedTime);
            newIncludedInfoCompVal.addArg(changeStr);

            OovString checkedStr;
            checkedStr.appendInt(curTime);
            newIncludedInfoCompVal.addArg(checkedStr);

            for(const auto &str : newMapItem.second)
                {
                size_t pos = newIncludedInfoCompVal.find(str);
                if(pos == CompoundValue::npos)
                    {
                    newIncludedInfoCompVal.addArg(str);
                    }
                }
            setNameValue(newMapItem.first, newIncludedInfoCompVal.getAsString());
            anyChanges = true;
            }
        }
    if(file.isOpen() && anyChanges)
        {
#if(SHARED_FILE)
        if(!writeFileExclusive(file))
            {
            OovString str = "Unable to write include map file";
            OovError::report(ET_Error, str);
            }
#else
        writeFile();
#endif
        }
    }
Ejemplo n.º 3
0
void NameValueRecord::insertLine(OovString lineBuf)
    {
    size_t colonPos = lineBuf.find(mapDelimiter);
    if(colonPos != std::string::npos)
        {
        std::string key = lineBuf.substr(0, colonPos);
        size_t termPos = lineBuf.find('\n');
        std::string value = lineBuf.substr(colonPos+1, termPos-(colonPos+1));
        setNameValue(key, value);
        }
    }
Ejemplo n.º 4
0
/* init:
 */
static void init(int argc, char *argv[])
{
    int c;

    aginit();
    while ((c = getopt(argc, argv, ":ngvum:o:G:?")) != -1) {
	switch (c) {
	case 'n':
	    packMode = l_node;
	    break;
	case 'g':
	    packMode = l_graph;
	    break;
	case 'm':
	    setInt(&margin, optarg);
	    break;
	case 'o':
	    outfp = openFile(optarg, "w");
	    break;
	case 'u':
	    packMode = l_undef;
	    break;
	case 'G':
	    if (*optarg)
		setNameValue(optarg);
	    else
		fprintf(stderr,
			"gvpack: option -G missing argument - ignored\n");
	    break;
	case 'v':
	    verbose = 1;
	    Verbose = 1;
	    break;
	case '?':
	    if (optopt == '?')
		usage(0);
	    else
		fprintf(stderr,
			"gvpack: option -%c unrecognized - ignored\n", optopt);
	    break;
	}
    }
    argv += optind;
    argc -= optind;

    if (argc) {
	myFiles = argv;
	nGraphs = argc;		/* guess one graph per file */
    } else
	nGraphs = 10;		/* initial guess as to no. of graphs */
    if (!outfp)
	outfp = stdout;		/* stdout the default */
}
Ejemplo n.º 5
0
void EditOptions::setScreenCoord(char const * const tag, int val)
    {
    OovString str;
    str.appendInt(val);
    setNameValue(tag, str);
    }
Ejemplo n.º 6
0
/* init:
 */
static void init(int argc, char *argv[], pack_info* pinfo)
{
    int c, len;
    char buf[BUFSIZ];
    char* bp;

    agnodeattr(NULL, "label", NODENAME_ESC);
    pinfo->mode = l_clust;
    pinfo->margin = CL_OFFSET;
    pinfo->doSplines = TRUE; /* Use edges in packing */
    pinfo->fixed = 0;
    pinfo->sz = 0;

    opterr = 0;
    while ((c = getopt(argc, argv, ":na:gvum:s:o:G:")) != -1) {
	switch (c) {
	case 'a':
	    len = strlen(optarg) + 2;
	    if (len > BUFSIZ)
		bp = N_GNEW(len, char);
	    else
		bp = buf;
	    sprintf (bp, "a%s\n", optarg);
	    parsePackModeInfo (bp, pinfo->mode, pinfo);
	    if (bp != buf)
		free (bp);
	    break;
	case 'n':
	    parsePackModeInfo ("node", pinfo->mode, pinfo);
	    break;
	case 's':
	    gname = optarg;
	    break;
	case 'g':
	    parsePackModeInfo ("graph", pinfo->mode, pinfo);
	    break;
	case 'm':
	    setUInt(&pinfo->margin, optarg);
	    break;
	case 'o':
	    outfp = openFile(optarg, "w");
	    break;
	case 'u':
	    pinfo->mode = l_undef;
	    break;
	case 'G':
	    if (*optarg)
		setNameValue(optarg);
	    else
		fprintf(stderr,
			"gvpack: option -G missing argument - ignored\n");
	    break;
	case 'v':
	    verbose = 1;
	    Verbose = 1;
	    break;
	case ':':
	    fprintf(stderr, "gvpack: option -%c missing argument - ignored\n", optopt);
	    break;
	case '?':
	    if (optopt == '?')
		usage(0);
	    else
		fprintf(stderr,
			"gvpack: option -%c unrecognized - ignored\n", optopt);
	    break;
	}
    }
Ejemplo n.º 7
0
void NameValueRecord::setNameValueBool(OovStringRef const optionName, bool val)
    {
    setNameValue(optionName, val ? "Yes" : "No");
    }