summaryrefslogtreecommitdiff
path: root/xmlspec/XMLRPMWrap.h
blob: d7417610af1e4c8772c2e053be6893b9d9cdb4f2 (plain)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef _H_XMLRPMWRAP_
#define _H_XMLRPMWRAP_

// standard C++ includes
#include <string>
#include <vector>

// rpm includes
#include <rpmlib.h>

// type definitions
typedef vector<string> t_StrVector;

/**
 * Gets an RPM header after checking that is does exist.
 * .
 * @param header The RPM header to interrogate
 * @param nTag The header tag to extract
 * @param rResult The string to populate with the result
 * @return true on success, false otherwise
 **/
extern bool getRPMHeader(Header header,
						 int_32 nTag,
						 std::string& rResult);

/**
 * Gets an RPM header array into a vector after checking that it
 * does indeed exist
 * .
 * @param header The RPM header to interrogate
 * @param nTag The header tag to extract
 * @param rvResult The vector<string> to populate with the result
 * @return true on success, false otherwise
 **/
extern bool getRPMHeaderArray(Header header,
							  int_32 nTag,
							  t_StrVector& rvResult);

/**
 * Gets a specific RPM macro
 * .
 * @param szMacro The macro to get the value of
 * @param rResult The string to populate with the result
 * @return true on success, false otherwise
 **/
extern bool getRPMMacro(const char* szMacro,
						std::string& rResult);

#endif