moved from libcommon to libscstring

This commit is contained in:
Bob Polis 2020-04-12 22:33:47 +02:00
parent a94f6d1f27
commit 16c8a44251
2 changed files with 6 additions and 6 deletions

View File

@ -22,7 +22,7 @@ else
CXXFLAGS += -O3 CXXFLAGS += -O3
endif endif
LDLIBS := -lm -lpthread -lcommon LDLIBS := -lm -lpthread -lscstring
LDFLAGS := LDFLAGS :=
all: $(BIN) all: $(BIN)

View File

@ -6,6 +6,9 @@
// Copyright (c) 2019 SwiftCoder. All rights reserved. // Copyright (c) 2019 SwiftCoder. All rights reserved.
// //
// libcommon
#include <libscstring.hpp>
// UNIX // UNIX
#include <unistd.h> #include <unistd.h>
#include <libgen.h> #include <libgen.h>
@ -14,9 +17,6 @@
#include <iostream> #include <iostream>
using namespace std; using namespace std;
// libcommon
#include <libcommon.hpp>
int main(int argc, const char * argv[]) { int main(int argc, const char * argv[]) {
int result = EXIT_SUCCESS; int result = EXIT_SUCCESS;
try { try {
@ -24,9 +24,9 @@ int main(int argc, const char * argv[]) {
if (argc == 1) { if (argc == 1) {
cin >> text; cin >> text;
} else { } else {
text = su::file_get_contents(argv[1]); text = sc::file_get_contents(argv[1]);
} }
result = su::is_valid_utf8(text) ? EXIT_SUCCESS : EXIT_FAILURE; result = sc::is_valid_utf8(text) ? EXIT_SUCCESS : EXIT_FAILURE;
} catch (const exception& ex) { } catch (const exception& ex) {
cerr << basename(const_cast<char*>(argv[0])) << ": " << ex.what() << '\n'; cerr << basename(const_cast<char*>(argv[0])) << ": " << ex.what() << '\n';
result = EXIT_FAILURE; result = EXIT_FAILURE;