aboutsummaryrefslogtreecommitdiff
path: root/build/name
blob: db7b61c2ff952d0b612423e7e76cc139288578f6 (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
// file      : build/name -*- C++ -*-
// copyright : Copyright (c) 2014-2015 Code Synthesis Tools CC
// license   : MIT; see accompanying LICENSE file

#ifndef BUILD_NAME
#define BUILD_NAME

#include <string>
#include <vector>
#include <iosfwd>
#include <utility> // move()

#include <build/path>

namespace build
{
  // A name is what we operate on by default. Depending on the context,
  // it can be interpreted as a target or prerequisite name. A name
  // without a type and directory can be used to represent any text.
  //
  struct name
  {
    explicit
    name (std::string v): value (std::move (v)) {}

    name (std::string t, path d, std::string v)
        : type (std::move (t)), dir (std::move (d)), value (std::move (v)) {}

    std::string type;
    path dir;
    std::string value;
  };

  typedef std::vector<name> names;

  std::ostream&
  operator<< (std::ostream&, const name&);

  std::ostream&
  operator<< (std::ostream&, const names&);
}

#endif // BUILD_NAME