aboutsummaryrefslogtreecommitdiff
path: root/bpkg/manifest-utility
blob: c6d9ab8ad104a8b2bd9e3ab0a05f051a7813cb92 (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
// file      : bpkg/manifest-utility -*- C++ -*-
// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
// license   : MIT; see accompanying LICENSE file

#ifndef BPKG_MANIFEST_UTILITY
#define BPKG_MANIFEST_UTILITY

#include <bpkg/manifest>

#include <bpkg/types>
#include <bpkg/utility>

namespace bpkg
{
  // Package naming schemes.
  //
  enum class package_scheme
  {
    none,
    sys
  };

  // Extract scheme from [<scheme>:]<package>. Position the pointer right after
  // the scheme end if present, otherwise leave unchanged.
  //
  package_scheme
  parse_package_scheme (const char*&);

  // Extract name and version components from <name>[/<version>].
  //
  string
  parse_package_name (const char*);

  version
  parse_package_version (const char*);

  // First use the passed location as is. If the result is relative,
  // then assume this is a relative path to the repository directory
  // and complete it based on the current working directory.
  //
  repository_location
  parse_location (const char*);
}

#endif // BPKG_MANIFEST_UTILITY