GithubHelp home page GithubHelp logo

isabella232 / uap-cpp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ua-parser/uap-cpp

0.0 0.0 0.0 108 KB

C++ implementation of ua-parser

License: MIT License

C++ 94.08% Makefile 2.59% CMake 3.33%

uap-cpp's Introduction

ua_parser C++ Library

Usage

Linux

To build the (static) library:

make uaparser_cpp

To build and run the tests:

make test

A recent (GCC >= 4.8 or Clang >= 3.9 both work) C++11 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 tests

Run from uap-cpp directory:

./build/UaParserTest
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 API)
  • 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.

uap-cpp's People

Contributors

asuhan avatar dailymats avatar ironholds avatar rayrapetyan avatar sparkcm avatar teambob avatar artemklevtsov avatar clarfonthey avatar hsluoyz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.