summaryrefslogtreecommitdiff
path: root/libhello/libhello/hello.hxx
blob: f0fc49ecefc59457d23927486b66fe4052a3f276 (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
#pragma once

#include <iosfwd>
#include <string>

#include <libformat/format.hxx>

#include <libhello/export.hxx>

namespace hello
{
  // If you compare this interface to version 1.0, then you will notice that
  // while it is API/source-compatible (the call via the old signature of
  // say_hello() is still valid) it is not ABI/binary-compatible (say_hello()
  // now has an extra argument and is inline).
  //
  // Notice also that say_hello() now uses a type and calls (from its inline
  // implementation) a function from format which means libformat is an
  // "interface dependency" of libhello.

  LIBHELLO_SYMEXPORT void
  say_hello_formatted (std::ostream&, const std::string& hello);

  inline void
  say_hello (std::ostream& o,
             const std::string& name,
             format::volume v = format::volume::normal)
  {
    say_hello_formatted (o, format::format_hello ("Hello", name, v));
  }
}