{"id":20601823,"url":"https://github.com/xeptore/library-management","last_synced_at":"2025-04-15T01:53:25.211Z","repository":{"id":137861507,"uuid":"183560665","full_name":"xeptore/library-management","owner":"xeptore","description":"Educational-purpose library management cli app using C++","archived":false,"fork":false,"pushed_at":"2019-06-07T03:30:35.000Z","size":96,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-15T01:53:15.696Z","etag":null,"topics":["cmake","cpp11","educational","library","library-management","library-management-system"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xeptore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-26T05:07:24.000Z","updated_at":"2023-03-10T14:44:38.000Z","dependencies_parsed_at":"2023-07-07T14:16:28.772Z","dependency_job_id":null,"html_url":"https://github.com/xeptore/library-management","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xeptore%2Flibrary-management","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xeptore%2Flibrary-management/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xeptore%2Flibrary-management/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xeptore%2Flibrary-management/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xeptore","download_url":"https://codeload.github.com/xeptore/library-management/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248991540,"owners_count":21194894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmake","cpp11","educational","library","library-management","library-management-system"],"created_at":"2024-11-16T09:12:06.509Z","updated_at":"2025-04-15T01:53:25.204Z","avatar_url":"https://github.com/xeptore.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# library-management\nEducational-purpose library management cli app using C++\n\n## Usage\n### Prerequisites:\n* CMake (download binaries from [official download page](https://cmake.org/download/#latest))\n* Some C++ compiler. on your own :)\n### 1. Clone repository:\n ```sh\n git clone git@github.com:xeptore/library-management.git\n cd library-management\n ```\n### 2. Build:\n```sh\ncd build\ncmake ..\nmake\n```\n### 3. Execute:\n```sh\n./bin/lib\n```\n\n## Lessons Learned:\n* First using CMake experience:  \nAs of current version (3.14.5), official documentation was a bit confusing, other blog posts (ill list them below, _BE PATIENT!_) were much more useful (and also much more _old_!)\n* First OOP experience in C++:  \nSeems a bit bothering, were CMake configurations, and _library linking_ things come in, and I couldnt really find out **why it was not working** (when following documentation), and **why it was working**!\nBut thinking in memory addresses, pointers, iterators, and standard data structures, was not so bad.\nAfter getting _odd!_ CMake configurations done and started _real_ programming, I found many similarities and thoughts as i had when i am programming with younger son of C++, Golang (_and also same feelings!_).\n---\n\n## Docs I've Used:\nHere are links to documentation and blog posts i've used till now:\n* [CMake Official Tutorial](https://cmake.org/cmake-tutorial/):  \nActually Step 2 for adding libraries (models and helper functions).\n* [This Blog Post](http://derekmolloy.ie/hello-world-introductions-to-cmake/):  \nVery helpful blog post i've found that helped me _finally_ configure CMake.\n* [This Blog Post](http://gernotklingler.com/blog/care-include-dependencies-cpp-keep-minimum/) and [This Reference Page](https://en.cppreference.com/w/cpp/language/class):  \nI had a problem ( another one :) ) in **circular library linking** which _somehow_ was same as what i had in Golang when i first started it.  \nThis blog post and this questions ([1](https://stackoverflow.com/questions/30223453/c-circular-dependency-in-header-files) \u0026 [2](https://stackoverflow.com/questions/39722036/circular-dependencies-between-c-classes)) helped me solve it using combination of _forward declaration_ and _pointer type class members_.  \n* [This Q/A](https://stackoverflow.com/questions/20153220/c-vector-stdbad-alloc-error):\nWhen i was working with `std::vector`s which contain pointers to some data types (book type), and iterating over them in `main.cpp` (not in their own class), i was getting `std::bad_alloc` error. In [this commit](https://github.com/xeptore/library-management/commit/6f5254270a6275b69ccbd8c3dd4bd3ce9acc2f34), and [these lines](https://github.com/xeptore/library-management/blob/6f5254270a6275b69ccbd8c3dd4bd3ce9acc2f34/src/main.cpp#L269-L274), where i have to iterate on _book_ `vector`, if i was using vector directly in the loop, it raises mentioned error, but when i store its address into another variable (in this case `books`) before the loop and then use that variable in loop iteration (`.begin()`, and `.end()`), everything would work fine.\n* [Standard Library Reference](http://www.cplusplus.com/reference/string/to_string/):\nSimple `std::to_string()` function used to convert `int` to `std::string`.\n* [This](https://www.hackerearth.com/practice/notes/validating-user-input-in-c/) and [this](https://mathbits.com/MathBits/CompSci/APstrings/APgetline.htm) blog posts:\nI had a problem using `std::getline()` function, which receives empty string when is was used after `cin`. I found this blog post and [this](https://stackoverflow.com/questions/5739937/using-getlinecin-s-after-cin) stackoverflow q/a useful in solving my problem.  \n* [gologger](https://github.com/xeptore/gologger):  \nMy own project. Used for copying ugly codes to colorize console outputs.  \nAnd also [this](https://en.wikipedia.org/wiki/ANSI_escape_code) WikiPedia  page for ASCII color codes.\n\n---\n\n2019 - [_@xeptore_](https://gitlab.com/xeptore)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxeptore%2Flibrary-management","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxeptore%2Flibrary-management","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxeptore%2Flibrary-management/lists"}