summaryrefslogtreecommitdiff
path: root/libhello/libhello/hello.hxx
blob: d9e41d9fdd2a0d77e3e58fb0be6cc8053fe433b4 (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
// file: libhello/hello.hxx -*- C++ -*-

#pragma once

#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() is still valid) it is not ABI/binary-compatible (say() now has an
  // extra argument and is inline).
  //
  // Notice also that inline say() now uses a type and calls a function from
  // format which means libformat is an "interface dependency" of libhello.

  LIBHELLO_EXPORT void
  say_formatted (const std::string& message);

  inline void
  say (const std::string& name, format::volume v = format::volume::normal)
  {
    say_formatted (format::message ("Hello", name, v));
  }
}