Skip to content

Commit

Permalink
Merge pull request #1 from EmperorPenguin18/testing
Browse files Browse the repository at this point in the history
0.2 Merge
  • Loading branch information
EmperorPenguin18 authored Nov 23, 2021
2 parents 287821f + c95d37c commit 329b9b5
Show file tree
Hide file tree
Showing 123 changed files with 13,457 additions and 67 deletions.
2,638 changes: 2,638 additions & 0 deletions Doxyfile

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Maintainer: Sebastien MacDougall-Landry

pkgname=libscry
pkgver=0.2
pkgrel=1
pkgdesc='A Magic: The Gathering library'
url='https://github.com/EmperorPenguin18/libscry/'
source=("$pkgname-$pkgver.tar.gz::https://github.com/EmperorPenguin18/libscry/archive/refs/tags/$pkgver.tar.gz")
arch=('x86_64')
license=('GPL3')
depends=('curl' 'sqlite' 'rapidjson')
sha256sums=('')

build () {
cd "$srcdir/$pkgname-$pkgver"
g++ -std=c++20 -lcurl -lsqlite3 -fPIC -shared libscry.cc -o libscry.so
}

package () {
cd "$srcdir/$pkgname-$pkgver"
install -Dm755 libscry.so -t "$pkgdir/usr/lib"
install -Dm644 libscry.h -t "$pkgdir/usr/include"
}
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,26 @@
A Magic: The Gathering library

Uses Scryfall API to generate card data.

## Dependencies

curl, sqlite3 and jsoncpp

curl, sqlite3 and rapidjson
## Install
Arch
```
git clone https://github.com/EmperorPenguin18/libscry
cd libscry
makepkg -si
```
Or just install from the [AUR](https://aur.archlinux.org/packages/libscry)

Other Linux
```
git clone https://github.com/EmperorPenguin/libscry
cd libscry
make
make install #as root
```

## Documentation
Available in [docs](docs/)
## Legal
From the API Docs:

Expand Down
82 changes: 82 additions & 0 deletions docs/html/annotated.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libscry: Class List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">libscry<span id="projectnumber">&#160;0.2</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
<div class="headertitle"><div class="title">Class List</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock">Here are the classes, structs, unions and interfaces with brief descriptions:</div><div class="directory">
<table class="directory">
<tr id="row_0_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classCard.html" target="_self">Card</a></td><td class="desc">This class is used to represent a single card </td></tr>
<tr id="row_1_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classList.html" target="_self">List</a></td><td class="desc">This class is used to represent a list of cards (returned from a search for example) </td></tr>
<tr id="row_2_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structmemory.html" target="_self">memory</a></td><td class="desc"></td></tr>
<tr id="row_3_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classScry.html" target="_self">Scry</a></td><td class="desc">This class is the main interface to Scryfall. It handles all the API requests and caching </td></tr>
</table>
</div><!-- directory -->
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2
</small></address>
</body>
</html>
Binary file added docs/html/bc_s.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/html/bdwn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
86 changes: 86 additions & 0 deletions docs/html/classCard-members.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libscry: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">libscry<span id="projectnumber">&#160;0.2</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">Card Member List</div></div>
</div><!--header-->
<div class="contents">

<p>This is the complete list of members for <a class="el" href="classCard.html">Card</a>, including all inherited members.</p>
<table class="directory">
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Card</b>(const char *rawjson) (defined in <a class="el" href="classCard.html">Card</a>)</td><td class="entry"><a class="el" href="classCard.html">Card</a></td><td class="entry"></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classCard.html#a7e1daf48776a7816077ece1f7bed3f23">dual_sided</a>()</td><td class="entry"><a class="el" href="classCard.html">Card</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classCard.html#a02c5d509ff7886c8a872459757ba78b6">json</a>()</td><td class="entry"><a class="el" href="classCard.html">Card</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classCard.html#a015752347c4fdcd99f4e5e67fa58dce7">mana_cost</a>()</td><td class="entry"><a class="el" href="classCard.html">Card</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classCard.html#a614a347cba56f494443830b95f509c60">name</a>()</td><td class="entry"><a class="el" href="classCard.html">Card</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classCard.html#a6dfc7f7ee78096a24c1d0eaa0d3bcea7">oracle_text</a>()</td><td class="entry"><a class="el" href="classCard.html">Card</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classCard.html#a2019158130ec431bcbd7da81e2bd430e">power</a>()</td><td class="entry"><a class="el" href="classCard.html">Card</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classCard.html#a5764109aac819c9c2b21c5b0b0a2691a">toughness</a>()</td><td class="entry"><a class="el" href="classCard.html">Card</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classCard.html#a9b4ae24b362baf8b7685a08dec3f34cb">type_line</a>()</td><td class="entry"><a class="el" href="classCard.html">Card</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2
</small></address>
</body>
</html>
127 changes: 127 additions & 0 deletions docs/html/classCard.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libscry: Card Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">libscry<span id="projectnumber">&#160;0.2</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classCard-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">Card Class Reference</div></div>
</div><!--header-->
<div class="contents">

<p>This class is used to represent a single card.
<a href="classCard.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="libscry_8h_source.html">libscry.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a4a9de61e1204358840f8c9b6b0975c3c"><td class="memItemLeft" align="right" valign="top"><a id="a4a9de61e1204358840f8c9b6b0975c3c" name="a4a9de61e1204358840f8c9b6b0975c3c"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>Card</b> (const char *rawjson)</td></tr>
<tr class="separator:a4a9de61e1204358840f8c9b6b0975c3c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a614a347cba56f494443830b95f509c60"><td class="memItemLeft" align="right" valign="top"><a id="a614a347cba56f494443830b95f509c60" name="a614a347cba56f494443830b95f509c60"></a>
virtual string&#160;</td><td class="memItemRight" valign="bottom"><b>name</b> ()</td></tr>
<tr class="memdesc:a614a347cba56f494443830b95f509c60"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the name (Storm Crow) of the card. <br /></td></tr>
<tr class="separator:a614a347cba56f494443830b95f509c60"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a015752347c4fdcd99f4e5e67fa58dce7"><td class="memItemLeft" align="right" valign="top"><a id="a015752347c4fdcd99f4e5e67fa58dce7" name="a015752347c4fdcd99f4e5e67fa58dce7"></a>
virtual string&#160;</td><td class="memItemRight" valign="bottom"><b>mana_cost</b> ()</td></tr>
<tr class="memdesc:a015752347c4fdcd99f4e5e67fa58dce7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the mana cost ({1}{U}) of the card. <br /></td></tr>
<tr class="separator:a015752347c4fdcd99f4e5e67fa58dce7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9b4ae24b362baf8b7685a08dec3f34cb"><td class="memItemLeft" align="right" valign="top"><a id="a9b4ae24b362baf8b7685a08dec3f34cb" name="a9b4ae24b362baf8b7685a08dec3f34cb"></a>
virtual string&#160;</td><td class="memItemRight" valign="bottom"><b>type_line</b> ()</td></tr>
<tr class="memdesc:a9b4ae24b362baf8b7685a08dec3f34cb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the type line (Creature - Bird) of the card. <br /></td></tr>
<tr class="separator:a9b4ae24b362baf8b7685a08dec3f34cb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6dfc7f7ee78096a24c1d0eaa0d3bcea7"><td class="memItemLeft" align="right" valign="top"><a id="a6dfc7f7ee78096a24c1d0eaa0d3bcea7" name="a6dfc7f7ee78096a24c1d0eaa0d3bcea7"></a>
virtual string&#160;</td><td class="memItemRight" valign="bottom"><b>oracle_text</b> ()</td></tr>
<tr class="memdesc:a6dfc7f7ee78096a24c1d0eaa0d3bcea7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the oracle text (Flying) of the card. <br /></td></tr>
<tr class="separator:a6dfc7f7ee78096a24c1d0eaa0d3bcea7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2019158130ec431bcbd7da81e2bd430e"><td class="memItemLeft" align="right" valign="top"><a id="a2019158130ec431bcbd7da81e2bd430e" name="a2019158130ec431bcbd7da81e2bd430e"></a>
virtual string&#160;</td><td class="memItemRight" valign="bottom"><b>power</b> ()</td></tr>
<tr class="memdesc:a2019158130ec431bcbd7da81e2bd430e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the power (1) of the card. <br /></td></tr>
<tr class="separator:a2019158130ec431bcbd7da81e2bd430e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5764109aac819c9c2b21c5b0b0a2691a"><td class="memItemLeft" align="right" valign="top"><a id="a5764109aac819c9c2b21c5b0b0a2691a" name="a5764109aac819c9c2b21c5b0b0a2691a"></a>
virtual string&#160;</td><td class="memItemRight" valign="bottom"><b>toughness</b> ()</td></tr>
<tr class="memdesc:a5764109aac819c9c2b21c5b0b0a2691a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the toughness (2) of the card. <br /></td></tr>
<tr class="separator:a5764109aac819c9c2b21c5b0b0a2691a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7e1daf48776a7816077ece1f7bed3f23"><td class="memItemLeft" align="right" valign="top"><a id="a7e1daf48776a7816077ece1f7bed3f23" name="a7e1daf48776a7816077ece1f7bed3f23"></a>
virtual bool&#160;</td><td class="memItemRight" valign="bottom"><b>dual_sided</b> ()</td></tr>
<tr class="memdesc:a7e1daf48776a7816077ece1f7bed3f23"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the card has two faces, false otherwise. <br /></td></tr>
<tr class="separator:a7e1daf48776a7816077ece1f7bed3f23"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a02c5d509ff7886c8a872459757ba78b6"><td class="memItemLeft" align="right" valign="top"><a id="a02c5d509ff7886c8a872459757ba78b6" name="a02c5d509ff7886c8a872459757ba78b6"></a>
virtual string&#160;</td><td class="memItemRight" valign="bottom"><b>json</b> ()</td></tr>
<tr class="memdesc:a02c5d509ff7886c8a872459757ba78b6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the raw json text of the card provided by Scryfall. <br /></td></tr>
<tr class="separator:a02c5d509ff7886c8a872459757ba78b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >This class is used to represent a single card. </p>
</div><hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="libscry_8h_source.html">libscry.h</a></li>
<li>libscry.cc</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2
</small></address>
</body>
</html>
Loading

0 comments on commit 329b9b5

Please sign in to comment.