Thad House
6767afd400
Adds a UDPClient ( #60 )
...
Send only currently. Will eventually implement receive, but not
necessary for now.
2017-11-28 00:53:10 -08:00
Peter Johnson
877c7f51c1
raw_istream: Don't forward declare Twine et al. ( #59 )
...
It breaks existing users who use StringRef.
2017-11-22 23:49:57 -08:00
Peter Johnson
912b74151f
Use llvm::Twine instead of llvm::StringRef in several places. ( #58 )
2017-11-22 21:47:56 -08:00
Peter Johnson
f73db4a49b
Twine::isSingleStringRef(): Support CharKind. ( #57 )
2017-11-22 21:38:25 -08:00
Peter Johnson
85e83f1bba
WPI_Now(): return microseconds, and make backend replaceable. ( #56 )
...
- Add function documentation.
- Use uint64_t instead of unsigned long long
2017-11-19 11:47:06 -08:00
Peter Johnson
e4deda5ccb
Fix SafeThread bad merge. ( #53 )
2017-11-12 23:00:50 -08:00
Peter Johnson
80618a2e64
Use wpi mutex and condition_variable. ( #52 )
2017-11-12 22:12:03 -08:00
Peter Johnson
e45b6e0f65
Fix typo in priority_condition_variable. ( #51 )
2017-11-12 22:11:08 -08:00
Peter Johnson
9d8a508cd5
Add priority_mutex and priority_condition_variable. ( #50 )
...
Also provide wpi::mutex and wpi::condition_variable as wrappers for these
on Linux (where they're available), and for std::mutex and
std::condition_variable on other platforms.
2017-11-12 20:56:29 -08:00
Peter Johnson
c9ead29f44
SafeThread: Simplify m_lock assignment. ( #49 )
...
Instead of construct-and-swap, just use the move operator=.
2017-11-12 20:10:55 -08:00
Peter Johnson
f77fd1eca9
Set SO_EXCLUSIVEADDRUSE for server sockets on Windows. ( #44 )
...
On Windows, the shutdown() call relies on exclusively owning the server
socket.
2017-11-11 16:27:33 -08:00
Peter Johnson
5a5e753921
LLVM path: Don't follow symlinks. ( #48 )
...
This causes issues in recursive_directory_iterator.
2017-11-11 16:27:07 -08:00
Peter Johnson
8e797a1a1d
Import filesystem directory iterators from llvm. ( #43 )
...
Note: these are similar to the C++17 ones, but don't have quite the same API.
2017-11-03 11:40:42 -07:00
Thad House
a6c7789b5e
Removes specific raspbian, armv7 and armv8 cross builds ( #41 )
...
Will make the cross platform build case easier. A bit more difficult to
consume, but will be easier in the long run.
2017-10-14 21:57:53 -07:00
Peter Johnson
3faecdb353
Add SHA1 algorithm implementation. ( #32 )
...
Largely based on https://github.com/vog/sha1 with some customizations and
optimizations.
2017-09-10 17:21:19 -07:00
Peter Johnson
ef85809690
Fix bug in raw_fd_istream::read_impl(). ( #30 )
...
It would not set error if read() returned 0 (indicating EOF).
2017-09-06 22:06:21 -07:00
Peter Johnson
041563f8ea
Change UidVector to be LRU with a reuse threshold. ( #29 )
...
This keeps indexes from being instantly reused and reduces the risk of
accidentally using an old index.
Also change erase and emplace_back to return 0-based instead of 1-based
indexes.
This is a breaking change, but a noisy one due to the template parameter
change.
2017-09-06 19:54:58 -07:00
Thad House
c3f7c85f8a
Adds wpi GetHostname function ( #25 )
2017-08-27 21:35:34 -07:00
Thad House
5d403a7b49
Makes an empty stringref have a valid Data pointer ( #28 )
...
Now acts similar to std::string, where an empty construction string is valid.
2017-08-26 10:04:11 -07:00
Thad House
8416b4e42c
Add default parameter to StringRef to allow null termination on lengthed strings. ( #27 )
2017-08-23 21:02:11 -05:00
Peter Johnson
68501759fa
tcpsockets: Don't pull in platform-specific headers in headers. ( #26 )
...
This pollutes the namespace for all users of these headers.
This is particularly an issue on Windows.
2017-08-23 01:27:19 -05:00
Peter Johnson
43c103c0ac
Update googletest and googlemock to 1.8.0. ( #23 )
2017-08-15 23:53:20 -07:00
Peter Johnson
fa7d5bc023
Add UidVector (used in both ntcore and cscore Notifier). ( #22 )
2017-08-14 22:58:11 -07:00
Peter Johnson
855df5d679
raw_mem_istream: Add StringRef constructor.
2017-08-13 12:18:19 -07:00
Peter Johnson
c8d9cc7e5b
Add filename constructor to raw_fd_istream.
2017-08-13 12:18:19 -07:00
Peter Johnson
1c1fbf14cf
Import LLVM openFileForRead and openFileForWrite.
2017-08-13 12:18:19 -07:00
Peter Johnson
7d9e6b7e22
Move ReadLine into raw_istream class as getline. ( #20 )
2017-08-13 00:56:35 -07:00
Peter Johnson
17b5cace5b
Base64: Add raw_ostream and SmallString interfaces. ( #19 )
2017-08-13 00:55:56 -07:00
Thad House
2fa41b23b9
Add a java version of the dev app. ( #16 )
2017-08-12 23:52:08 -07:00
Peter Johnson
7e011bda6f
Add HTTP utilities. ( #7 )
...
Imported from cscore.
2017-08-06 23:28:21 -07:00
Peter Johnson
8418c39120
Add Path and Twine components from LLVM. ( #10 )
2017-08-06 23:26:42 -07:00
Peter Johnson
25c8e873d0
TCPConnector: Add method to connect to server in parallel. ( #6 )
...
This substantially speeds up connection times compared to sequentially
trying to connect to each server in round-robin fashion.
2017-08-03 16:45:42 -05:00
Thad House
bd899a7a7c
Fixes mac RuntimeDetector ( #11 )
2017-08-02 13:17:26 -07:00
Peter Johnson
301442ee43
Add json support to wpiutil.
...
This is a modified version of https://github.com/nlohmann/json .
It's been moved into the wpi namespace as many of the changes are not
compatible. The amount of template code has been significantly reduced,
enabling many functions to be moved out-of-line, and for the result to
build on older compiler versions (in particular GCC 4.8).
2017-07-28 21:55:03 -07:00
Peter Johnson
436ed4d1e3
Implement comparison operators for llvm::StringMap.
2017-07-28 21:55:03 -07:00
Peter Johnson
9385d1b6d8
GetJavaStackTrace: Provide llvm::StringRef excludeFuncPrefix. ( #3 )
...
This is a bit cleaner to use than the templated version (many compilers
have issues with templating on static strings, for example).
2017-07-28 18:08:54 -07:00
Peter Johnson
b90653f3e3
Logger: Add def_func and min_level constructors. ( #2 )
2017-07-28 18:08:31 -07:00
Thad House
1243cf04ea
Adds new build system to repo ( #1 )
2017-07-28 07:29:49 -07:00
Peter Johnson
95ad4783f1
Revert "Fixes TCPAcceptor able to use an empty string ( #172 )"
...
This doesn't actually do anything since the outer if statement checks
for empty m_address already.
This reverts commit 6ad9f45d9a .
2016-12-26 13:55:21 -08:00
Thad House
9a0a1baa6b
Fixes TCPAcceptor able to use an empty string ( #172 )
2016-12-26 12:27:08 -08:00
Peter Johnson
976ca80056
Use InetNtop on Win32 rather than WSAAddressToString. ( #170 )
...
Similarly, use InetPton rather than WSAStringToAddress.
The WSAAddressToString function is intended to provide a user-readable
string and thus includes the port number. This breaks some use cases
on Windows which expect to get just the IP address.
Note: The InetPton and InetNtop functions are available only in Vista or above.
2016-12-25 01:30:12 -08:00
Peter Johnson
8c7338f2ba
TCPAcceptor: Include port number in error messages. ( #166 )
2016-12-23 20:36:45 -06:00
Peter Johnson
558b2ffa41
NetworkStream: Add setBlocking() and getNativeHandle(). ( #161 )
...
Also add checking for "would block" errors in send() and receive().
Check for set nonblocking failures in TCPConnector as well (generate warnings rather than errors)
2016-11-27 19:59:52 -08:00
Austin Schuh
00b76d42e0
Fixed unused variable warning from gcc. ( #159 )
...
This makes it so that ntcore builds with -Wextra -Werror
2016-11-26 16:28:50 -08:00
Thad House
2657d89178
Adds a c_str method to StringRef ( #155 )
...
The StringRef class does not ensure the string is null terminated. As there is
no defined way to actually check for a null terminator, we determine
if it is null terminated based on the constructor type. Then if on c_str
it is not known to be null terminated, we use a passed in buffer to copy
the string and ensure null termination.
2016-11-14 22:51:52 -08:00
Peter Johnson
e4234f5198
raw_istream: Add std::istream style in_avail(). ( #135 )
2016-10-21 22:50:38 -07:00
Peter Johnson
7b3f6eeae2
Add raw_fd_istream. ( #121 )
2016-10-08 16:03:33 -07:00
Peter Johnson
15cb505163
TCPStream: Avoid SIGPIPE signals.
...
On Mac, this is done by setting SO_NOSIGPIPE on the socket.
On Linux, this is done with MSG_NOSIGNAL on the send call.
2016-10-08 16:02:55 -07:00
Peter Johnson
f711ced4ca
Add raw_socket_ostream.
...
This wraps NetworkStream in a llvm::raw_ostream.
2016-09-25 19:48:49 -07:00
Peter Johnson
4c6c096c50
Change API of raw_istream to be more similar to raw_ostream.
2016-09-25 19:48:49 -07:00