blob: 3191162c35b8ddbf53cc053eac4bb4760cf0f8e2 (
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
|
// -*- C++ -*-
// $Id$
#include "test_i.h"
ACE_RCSID(Application_Test, test_i, "$Id$")
CORBA::Boolean
inventory_i::getCDinfo (const char * artist,
char *& title,
CORBA::Float_out price
TAO_ENV_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException))
{
CORBA::Boolean in_stock = 0;
price = 0.0f;
ACE_CString name_key ("Beatles");
ACE_CString name (artist);
if (name.strstr (name_key) != -1)
{
ACE_CString title_key ("Sgt. Pepper");
ACE_CString working_title (title);
if (working_title.strstr (title_key) != -1)
{
title =
CORBA::string_dup ("Sgt. Pepper's Lonely Hearts Club Band");
price = 13.49f;
in_stock = 1;
}
else
{
title = CORBA::string_dup ("not found");
}
}
else
{
title = CORBA::string_dup ("not found");
}
return in_stock;
}
|