Commit 8f5d36f6 authored by Paul Asmuth's avatar Paul Asmuth
Browse files

switch to fmtlib

parent 858b4e4a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ file(GLOB source_files "core/*.cc" "core/**/*.cc" "elements/*.cc" "elements/**/*
list(REMOVE_ITEM source_files "core/cli.cc")
add_library(fviz STATIC ${source_files})
set_target_properties(fviz PROPERTIES PUBLIC_HEADER "source/fviz.h;source/fviz_sdl.h")
set(fviz_LDFLAGS fviz ${CAIRO_LIBRARIES} ${FREETYPE_LIBRARIES} ${HARFBUZZ_LIBRARIES} ${HARFBUZZ_ICU_LIBRARIES} ${PNG_LIBRARIES} ${FONTCONFIG_LIBRARIES})
set(fviz_LDFLAGS fviz ${CAIRO_LIBRARIES} ${FREETYPE_LIBRARIES} ${HARFBUZZ_LIBRARIES} ${HARFBUZZ_ICU_LIBRARIES} ${PNG_LIBRARIES} ${FONTCONFIG_LIBRARIES} fmt)


# Build: CLI
+2 −2
Original line number Diff line number Diff line
@@ -86,8 +86,8 @@ If you have any questions please don't hesitate to reach out via [GitHub issues]
Building
--------

To build fviz, you need an up-to-date C++ compiler, cmake, libharfbuzz and
libfreetype. Run:
To build fviz, you need an up-to-date C++ compiler, cmake, fmtlib, libharfbuzz,
libfreetype and cairo. Run:

    $ cmake .
    $ make -j
+3 −3
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@
using namespace fviz;

void printError(const ReturnCode& rc) {
  std::cerr << StringUtil::format("ERROR: $0", rc.getMessage()) << std::endl;
  std::cerr << fmt::format("ERROR: {}", rc.getMessage()) << std::endl;
}

int main(int argc, const char** argv) {
@@ -56,8 +56,8 @@ int main(int argc, const char** argv) {

  if (flag_version) {
    std::cerr <<
        StringUtil::format(
            "fviz $0\n"
        fmt::format(
            "fviz {}\n"
            "Part of the fviz project (https://fviz.org)\n"
            "Copyright (c) 2019, Paul Asmuth, Laura Schlimmer.\n"
            "All rights reserved.\n\n",
+6 −6
Original line number Diff line number Diff line
@@ -112,7 +112,7 @@ ReturnCode data_load_strings_csv(
      !expr_is_value(args[1])) {
    return ReturnCode::errorf(
        "EARG",
        "invalid number of arguments to 'csv'; expected: 2, got: $0",
        "invalid number of arguments to 'csv'; expected: 2, got: {}",
        "..."); // FIXME
  }

@@ -140,7 +140,7 @@ ReturnCode data_load_strings_csv(
  if (header == headers.end()) {
    return ReturnCode::errorf(
        "EARG",
        "CSV column not found: $0",
        "CSV column not found: {}",
        column_name);
  }

@@ -149,7 +149,7 @@ ReturnCode data_load_strings_csv(
    if (row->size() < column_idx) {
      return ReturnCode::errorf(
          "EARG",
          "CSV invalid number of columns for row #$0",
          "CSV invalid number of columns for row #{}",
          std::distance(data_csv.begin(), row));
    }

@@ -173,7 +173,7 @@ ReturnCode data_load_csv(
    } catch (... ) {
      return ReturnCode::errorf(
          "EARG",
          "CSV invalid column in row #$0: '$1' is not a number",
          "CSV invalid column in row #{}: '{}' is not a number",
          std::distance(values_str.begin(), v) + 1,
          *v);
    }
@@ -188,7 +188,7 @@ ReturnCode data_load_strings(
  if (!expr || !expr_is_list(expr)) {
    return ReturnCode::errorf(
        "EARG",
        "argument error; expected a value, got: $0",
        "argument error; expected a value, got: {}",
        "..."); // FIXME
  }

@@ -207,7 +207,7 @@ ReturnCode data_load(
  if (!expr || !expr_is_list(expr)) {
    return ReturnCode::errorf(
        "EARG",
        "argument error; expected a value, got: $0",
        "argument error; expected a value, got: {}",
        "..."); // FIXME
  }

+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ ReturnCode element_build(
  auto elem_name = expr_get_value(expr);
  auto elem_iter = env.element_map.elements.find(elem_name);
  if (elem_iter == env.element_map.elements.end()) {
    return ReturnCode::errorf("EARG", "no such element: $0", elem_name);
    return ReturnCode::errorf("EARG", "no such element: {}", elem_name);
  }

  return elem_iter->second(env, expr, elem);
Loading