I am using g++ version 3.2 on RedHat 8.0.

Here is my my code as is:

bool MyFalse(const char* file)
{
        return false;
}


/*
  This function is to open a file and try and find a match to args[0], which is the 
reg expression.
        args[1] is the file name, which is converted to a different format.
        args[2], if exists and equals 1, then set icase to true
*/
int grep(char* DB, vector<string> args, string ip)
{
        ifstream InStream;
        string db = DB;
        string tmp;
        string path;
        vector<string> tokens;
        RegEx expression;

        if (args.size() != 2 && args.size() != 3)
        {
                cout << "In Function: 'grep' The Wrong number of arguments were 
given!!" << endl
                        << "The 'grep' function requires Pattern, File Name and 
optional Flag!!" << endl;
                exit(-1);
        }

        

        path = "../evals/" + db + "/LOCAL_SCANNERS/ANALYSIS/" + display_ip(ip) + 
"/INTERESTING/";

        //convert file to our dir. structure
        expression = "/";

        expression.Split(tokens, args[1]);

        if (tokens.size() > 1)
        {
                path = path + "_";
                for(int i=0; i<tokens.size()-1; i++)
                {
                        path = path + tokens[i] + "_";
                }
        }

        path = path + "[" + tokens[tokens.size()-1] + "]";

        if (args.size() == 3)
        {
                if (args[2] == "1")
                        expression.SetExpression(args[0], true);
                else 
                        expression = args[0];
        }
        else
                expression = args[0];


        //bool (*FindFilesCallback)(const char*);
        //FindFilesCallback cb; //= (FindFilesCallback) &(MyFalse);
        //cb = &MyFalse;
        //expression.FindFile(FindFilesCallback, path);
        /*********************************
                The next line the compiler does not like
        ************************************/
        expression.FindFile(&MyFalse, path);
        return 0;
}

-----Original Message-----
From: John Maddock [mailto:jm@;regex.fsnet.co.uk]
Sent: Wednesday, November 13, 2002 7:00 AM
To: Boost mailing list
Subject: Re: [boost] Trying to use FindFiles in RegEx Class


> Adding & infront of MyFalse results in the following error:
>
> no matching function for call to 'boost::RegEx::FindFiles(bool (*) (const
char*), std::string&)'

This is just plain weird, what compiler are you using?  And can you please
send me a short test case so I can double check things here?

Thanks,

John Maddock
http://ourworld.compuserve.com/homepages/john_maddock/index.htm


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to