File: mrc-user.cpp

package info (click to toggle)
mrc 1.3.16-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 332 kB
  • sloc: cpp: 1,724; sh: 15; makefile: 3
file content (29 lines) | stat: -rw-r--r-- 450 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
	Example of the use of resources created with mrc in a C++ application
*/

#include <iostream>

// Include the generated header file
#include "mrsrc.hpp"

int main()
{
	try
	{
		mrsrc::rsrc res("hello.txt");
		if (not res)
			throw std::runtime_error("Resource not found");
		
		std::cout.write(res.data(), res.size());
		std::cout << std::endl;
	}
	catch(const std::exception& e)
	{
		std::cerr << e.what() << '\n';
		exit(1);
	}
	
	return 0;
}