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
|
CXXFLAGS += -O3
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LDLIBS := -lm -lpthread -lcommon
|
LDLIBS := -lm -lpthread -lscstring
|
||||||
LDFLAGS :=
|
LDFLAGS :=
|
||||||
|
|
||||||
all: $(BIN)
|
all: $(BIN)
|
||||||
|
10
main.cpp
10
main.cpp
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user