#ifndef ACTION_H
#define ACTION_H

/*
Copyright 2005 Ethan McCallum (ethanqm -at- penguinmail.com)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

	http://www.apache.org/licenses/LICENSE-2.0

or in the file

	LICENSE

which is distributed with this package.

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
Limitations under the License.
*/


// - - - - - - - - - - - - - - - - - - - - 

#include<RPM.h>
#include<Product.h>
#include<AppException.h>

#include<string>
#include<functional>

class Action : std::unary_function< const RPM* , void >{

	public:
	virtual ~Action() throw() {}

	virtual void operator()( const Product& product ) throw() = 0 ;

	/*
	QQQ -- have operator() return a bool:
	the calling function can track total number of errors
	and call exit() with an error code, if need be.
	*/

	static bool createDir( const char* path ) throw() ;

	static std::string basename( const std::string& in ) ;

} ; // class Action

// - - - - - - - - - - - - - - - - - - - - 

#endif // #ifndef ACTION_H
