moved from libcommon to libscstring
This commit is contained in:
parent
a94f6d1f27
commit
16c8a44251
2
Makefile
2
Makefile
@ -22,7 +22,7 @@ else
|
||||
CXXFLAGS += -O3
|
||||
endif
|
||||
|
||||
LDLIBS := -lm -lpthread -lcommon
|
||||
LDLIBS := -lm -lpthread -lscstring
|
||||
LDFLAGS :=
|
||||
|
||||
all: $(BIN)
|
||||
|
10
main.cpp
10
main.cpp
@ -6,6 +6,9 @@
|
||||
// Copyright (c) 2019 SwiftCoder. All rights reserved.
|
||||
//
|
||||
|
||||
// libcommon
|
||||
#include <libscstring.hpp>
|
||||
|
||||
// UNIX
|
||||
#include <unistd.h>
|
||||
#include <libgen.h>
|
||||
@ -14,9 +17,6 @@
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
// libcommon
|
||||
#include <libcommon.hpp>
|
||||
|
||||
int main(int argc, const char * argv[]) {
|
||||
int result = EXIT_SUCCESS;
|
||||
try {
|
||||
@ -24,9 +24,9 @@ int main(int argc, const char * argv[]) {
|
||||
if (argc == 1) {
|
||||
cin >> text;
|
||||
} 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) {
|
||||
cerr << basename(const_cast<char*>(argv[0])) << ": " << ex.what() << '\n';
|
||||
result = EXIT_FAILURE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user