Ejemplo n.º 1
0
size_t TokensTree::ReserveFileForParsing(const cc_string& filename,bool preliminary)
{
    size_t index = GetFileIndex(filename);
    if (   m_FilesToBeReparsed.count(index)
	    && (  !m_FilesStatus.count(index)
		    || m_FilesStatus[index]==fpsDone) )
    {
        eraseFile(filename);
        m_FilesToBeReparsed.erase(index);
        m_FilesStatus[index]=fpsNotParsed;
    }
    if(m_FilesStatus.count(index))
    {
        FileParsingStatus status = m_FilesStatus[index];
        if(preliminary)
        {
            if(status >= fpsAssigned)
                return 0; // Already assigned
        }
        else
        {
            if(status > fpsAssigned)
                return 0; // No parsing needed
        }
    }
    m_FilesToBeReparsed.erase(index);
    m_FilesStatus[index]=preliminary ? fpsAssigned : fpsBeingParsed; // Reserve file
    return index;
}
Ejemplo n.º 2
0
DWORD CArchiveFS::GetFileIndex(char* szFileName) 
{
	// PRE: szFileName must be the filename only (no paths!)

	if (!m_bEntriesLoaded)
		LoadEntries();

	CHAR szFileNameLC[MAX_PATH];
	strcpy(szFileNameLC, szFileName);
	_strlwr(szFileNameLC);

	DWORD dwHash = this->HashString(szFileNameLC);

	DWORD dwIndex = GetFileIndex(dwHash);

#ifdef _DEBUG
	if (dwIndex != FS_INVALID_FILE)
	{
		CHAR szDebugMsg[1024];
		sprintf(szDebugMsg, "ArchiveFS: Requested file: %s...\n", szFileNameLC);
		OutputDebugString(szDebugMsg);
	}
#endif

	return dwIndex;


}
Ejemplo n.º 3
0
void CompilerPatternDlg::OnSubmit(wxCommandEvent& event)
{
    if(GetPattern().Trim().IsEmpty() || GetFileIndex().Trim().IsEmpty() || GetLineIndex().Trim().IsEmpty()) {
        wxMessageBox(_("Please fill all the fields"), _("CodeLite"), wxOK | wxICON_INFORMATION, this);
        return;
    }
    EndModal(wxID_OK);
}
Ejemplo n.º 4
0
bool TokensTree::IsFileParsed(const cc_string& filename)
{
    size_t index = GetFileIndex(filename);
    bool parsed = (m_FilesMap.count(index) &&
                   m_FilesStatus[index]!=fpsNotParsed &&
                  !m_FilesToBeReparsed.count(index)
                  );
    return parsed;
}
Ejemplo n.º 5
0
            std::string ToAlgebraic(Napoleon::Square square)
            {
                if (square == Constants::Squares::Invalid)
                    return "Invalid";

                std::string str = "";
                str += static_cast<char>(GetFileIndex(square) + 'a');
                str += std::to_string(GetRankIndex(square) + 1);

                return str;
            }
Ejemplo n.º 6
0
Archivo: dbginfo.c Proyecto: cc65/cc65
void DbgInfoLine (void)
/* Parse and handle LINE subcommand of the .dbg pseudo instruction */
{
    long Line;
    FilePos Pos = STATIC_FILEPOS_INITIALIZER;

    /* Any new line info terminates the last one */
    if (CurLineInfo) {
        EndLine (CurLineInfo);
        CurLineInfo = 0;
    }

    /* If a parameters follow, this is actual line info. If no parameters
    ** follow, the last line info is terminated.
    */
    if (CurTok.Tok == TOK_SEP) {
        return;
    }

    /* Parameters are separated by a comma */
    ConsumeComma ();

    /* The name of the file follows */
    if (CurTok.Tok != TOK_STRCON) {
        ErrorSkip ("String constant expected");
        return;
    }

    /* Get the index in the file table for the name */
    Pos.Name = GetFileIndex (&CurTok.SVal);

    /* Skip the name */
    NextTok ();

    /* Comma expected */
    ConsumeComma ();

    /* Line number */
    Line = ConstExpression ();
    if (Line < 0) {
        ErrorSkip ("Line number is out of valid range");
        return;
    }
    Pos.Line = Line;

    /* Generate a new external line info */
    CurLineInfo = StartLine (&Pos, LI_TYPE_EXT, 0);
}
Ejemplo n.º 7
0
void TokensTree::eraseFile(const cc_string& filename)
{
    int index = GetFileIndex(filename);
    eraseFile(index);
}
Ejemplo n.º 8
0
void TokensTree::FlagFileAsParsed(const cc_string& filename)
{
    m_FilesStatus[GetFileIndex(filename)]=fpsDone;
}
Ejemplo n.º 9
0
void TokensTree::FlagFileForReparsing(const cc_string& filename)
{
    m_FilesToBeReparsed.insert(GetFileIndex(filename));
}
Ejemplo n.º 10
0
void TokensTree::MarkFileTokensAsLocal(const cc_string& filename, bool local, void* userData)
{
    MarkFileTokensAsLocal(GetFileIndex(filename), local, userData);
}
Ejemplo n.º 11
0
FILETIME ArchFile::GetFileTime(const WCHAR *fileName)
{
    return GetFileTime(GetFileIndex(fileName));
}
Ejemplo n.º 12
0
char *ArchFile::GetFileDataByName(const WCHAR *fileName, size_t *len)
{
    return GetFileDataByIdx(GetFileIndex(fileName), len);
}
Ejemplo n.º 13
0
void TokensTree::RemoveFile(const wxString& filename)
{
    int index = GetFileIndex(filename);
    RemoveFile(index);
}