Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

C++ implementation of ua-parser

License

NotificationsYou must be signed in to change notification settings

ua-parser/uap-cpp

Repository files navigation

Usage

A recent (GCC >= 5.4 or Clang >= 3.9 both work) C++14 compiler is required.

CMake build

libraries
cd uap-cppmkdir buildcd buildcmake ..make uap-cpp-staticmake uap-cpp-shared
tests

Prepare gtest:

apt-get install libgtest-devapt-get install cmakecd /usr/src/gtestcmake CMakeLists.txtmakecp *.a /usr/lib

Run from build directory:

make test

Run from uap-cpp directory:

./build/uap-cpp-tests
benchmark

Run from build directory:

make bench

Run from uap-cpp directory:

time ./build/UaParserBench uap-core/regexes.yaml benchmarks/useragents.txt 1000

Windows

First, openuap-cpp.sln with MSVC 15 (Visual Studio 2017).

To build the (static) library:

build the "UaParser" project

To build and run the tests:

build the "UaParserTest" project

The MSVC projects assume boost to be installed at:C:\boost_1_69_0 and yaml to be installed at:C:\yaml-cpp. Change these paths if needed.boost_regex needs to be built from source in advance. For yaml-cpp, you can built it from source, or use a prebuilthere.

Dependencies

  • re2, yaml-cpp (>=0.5)
  • gtest (for testing)
  • uap-core, same directory level as uap-cpp. You can clone this repo with --recurse-submodules to get it. Alternatively, rungit submodule update --init.

Contributing

Pull requests are welcome. Useclang-format -i *.cpp *.h to format the sources before sending the patch.

Credits

Inspired from the D implementation by Shripad K and using agent data from BrowserScope.

About

C++ implementation of ua-parser

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors10


[8]ページ先頭

©2009-2025 Movatter.jp