예제 #1
0
파일: main.cpp 프로젝트: y0ja/CPP_Pool
int main(void) {
	Intern idiotOne;
	Bureaucrat hermes = Bureaucrat("Hermes Conrad", 37);
	Bureaucrat bob = Bureaucrat("Bobby Bobson", 123);
	OfficeBlock ob;
	ob.setIntern(idiotOne);
	ob.setSigner(bob);
	ob.setExecutor(hermes);
	try {
		ob.doBureaucracy("shrubbery creation", "Pigley");
	} catch (OfficeBlock::IncompleteOfficeException & e) {
		std::cout << e.what() << std::endl;
	} catch (Form::GradeTooLowException & e) {
		std::cout << e.what() << std::endl;
	}

	OfficeBlock	ob2;

	try {
		ob2.doBureaucracy("presidential pardon", "John Doe");
	} catch (OfficeBlock::IncompleteOfficeException & e) {
		std::cout << e.what() << std::endl;
	} catch (std::exception & e) {
		std::cout << e.what() << std::endl;
	}

	try {
		ob.doBureaucracy("cacac", "John Doe");
	} catch (OfficeBlock::IncompleteOfficeException & e) {
		std::cout << e.what() << std::endl;
	} catch (Intern::InvalidFormNameException & e) {
		std::cout << e.what() << std::endl;
	}
	return (0);
}
예제 #2
0
파일: main.cpp 프로젝트: z0mbie42/42
int main()
{
	{
	Intern idiotOne;
	Bureaucrat hermes = Bureaucrat("Hermes Conrad", 37);
	Bureaucrat bob = Bureaucrat("Bobby Bobson", 123);
	OfficeBlock ob;
	ob.setIntern(idiotOne);
	ob.setSigner(bob);
	ob.setExecutor(hermes);
	try {
		ob.doBureaucracy("mutant pig termination", "Pigley");
	} catch (std::exception& e) {
		std::cout << e.what() << std::endl;
	}
	}

	{
	Intern idiotOne;
	Bureaucrat hermes = Bureaucrat("Hermes Conrad", 1);
	Bureaucrat bob = Bureaucrat("Bobby Bobson", 1);
	OfficeBlock ob;
	ob.setIntern(idiotOne);
	ob.setSigner(bob);
	ob.setExecutor(hermes);
	try {
		ob.doBureaucracy("presidential pardon", "sysy");
	} catch (std::exception& e) {
		std::cout << e.what() << std::endl;
	}
	}

	return 0;
}