GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ua-parser/uap-cpp: C++ implementation of ua-parser

BranchesTags
Open more actions menu

Latest commit

 

History

106 Commits
106 Commits

Folders and files

NameName
Last commit message
Last commit date
benchmarks
benchmarks
 
 
internal
internal
 
 
uap-core @ 7e634c8
uap-core @ 7e634c8
 
 
.clang-format
.clang-format
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
.travis.yml
.travis.yml
 
 
CMakeLists.txt
CMakeLists.txt
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
UaParser
UaParser
 
 
UaParser.cpp
UaParser.cpp
 
 
UaParser.vcxproj
UaParser.vcxproj
 
 
UaParserTest.cpp
UaParserTest.cpp
 
 
UaParserTest.vcxproj
UaParserTest.vcxproj
 
 
packages.config
packages.config
 
 
test_device_type_mobile.yaml
test_device_type_mobile.yaml
 
 
uap-cpp.sln
uap-cpp.sln
 
 
uap-cppConfig.cmake.in
uap-cppConfig.cmake.in
 
 

Repository files navigation

ua_parser C++ Library

Usage

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

CMake build

libraries
cd uap-cpp
mkdir build
cd build
cmake ..

make uap-cpp-static

make uap-cpp-shared
tests

Prepare gtest:

apt-get install libgtest-dev
apt-get install cmake
cd /usr/src/gtest
cmake CMakeLists.txt
make
cp *.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, open uap-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 prebuilt here.

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, run git submodule update --init.

Contributing

Pull requests are welcome. Use clang-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

Readme
MIT license
Activity
Custom properties

Stars

41 stars

Watchers

9 watching

Forks

34 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.