File tree Expand file tree Collapse file tree 5 files changed +82
-0
lines changed Expand file tree Collapse file tree 5 files changed +82
-0
lines changed Original file line number Diff line number Diff line change @@ -29,17 +29,27 @@ class EnumFlagsConan(b2.B2.Mixin, ConanFile):
2929 url = "https://github.com/grisumbras/enum-flags"
3030 homepage = url
3131
32+ options = {"with_docs" : [False , True ]}
33+ default_options = {"with_docs" : False }
34+
3235 exports_sources = (
3336 "jamroot.jam" ,
3437 "*build.jam" ,
3538 "exports/*.jam" ,
3639 "*.hpp" ,
3740 "*.cpp" ,
3841 "LICENSE*" ,
42+ "*.adoc" ,
3943 )
4044 no_copy_source = True
4145 build_requires = "boost_build/[>=1.68]@bincrafters/stable"
4246
47+ def b2_setup_builder (self , builder ):
48+ if self .options .with_docs :
49+ builder .options .with_docs = True
50+ builder .using ("asciidoctor" )
51+ return builder
52+
4353 def package_info (self ):
4454 self .info .header_only ()
4555
Original file line number Diff line number Diff line change 1+ import asciidoctor ;
2+ import path ;
3+
4+
5+ project enum-flags-doc ;
6+
7+ path-constant HERE : . ;
8+
9+
10+ local rule templates-dir ( path ) {
11+ path = [ path.root $(path) $(HERE) ] ;
12+ local files = [ glob $(path)/* ] ;
13+ return <flags>"-T $(path)" <dependency>$(files) ;
14+ }
15+
16+
17+ alias common-attributes
18+ : usage-requirements
19+ <asciidoctor-attribute>nofooter
20+ <asciidoctor-attribute>source-highlighter=pygments
21+ <asciidoctor-attribute>pygments-linenums-mode=inline
22+ # <asciidoctor-attribute>pygments-css
23+
24+ # <asciidoctor-attribute>pygments-style=monokai
25+ <asciidoctor-attribute>pygments-style=paraiso-dark
26+
27+ # <asciidoctor-attribute>pygments-style=friendly
28+
29+ <asciidoctor-attribute>icons=font
30+ # <asciidoctor-attribute>stylesdir=styles
31+
32+ [ templates-dir templates ]
33+ ;
34+
35+
36+ html index : index.adoc common-attributes ;
Original file line number Diff line number Diff line change 1+ #include < flags/flags.hpp>
2+
3+ enum class MyEnum { Value1 = 1 , Value2 = 2 };
4+ ALLOW_FLAGS_FOR_ENUM (MyEnum)
5+
6+ int main() {
7+ auto mask = MyEnum::Value1 | MyEnum::Value2;
8+ if (mask & MyEnum::Value2) {
9+ // do something
10+ }
11+ return 0 ;
12+ }
Original file line number Diff line number Diff line change 1+ = enum-flags
2+
3+ *enum-flags* is a C++ library that allows you to convert scoped enums into bit
4+ flags. +
5+ You can use it as simple as this:
6+
7+ [source, c++]
8+ ----
9+ include::examples/example0.cpp[]
10+ ----
11+
12+ == Documentation
13+
14+ * *link:overview/index.html[Overview]* +
15+ An overview of the features and the design.
16+
17+ * *link:tutorial/index.html[Tutorial]* +
18+ A tutorial that shows how to use the library.
19+
20+ * *link:reference/index.html[Reference]* +
21+ API reference.
Original file line number Diff line number Diff line change 1+ import option ;
12import package ;
23import path ;
34
@@ -20,5 +21,7 @@ explicit headers ;
2021
2122package.install-data license : enum-flags : LICENSE ;
2223
24+ if [ option.get with-docs : : yes ] { build-project doc ; }
25+
2326alias install : headers license exports//install ;
2427explicit install headers license ;
You can’t perform that action at this time.
0 commit comments