Skip to content

Commit

Permalink
0
Browse files Browse the repository at this point in the history
  • Loading branch information
Beyondo committed Nov 30, 2022
1 parent d9256b7 commit 2a6dc9b
Show file tree
Hide file tree
Showing 165 changed files with 348,175 additions and 33 deletions.
45 changes: 13 additions & 32 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,32 +1,13 @@
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app
# Ignore everything
*
!*/
# Except these
!.gitignore
!*.ixx
!*.h
!*.hpp
!*.c
!*.cpp
!*.lib
# Ignore these modules
modules/ai
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,31 @@
# null
# Null
A cross-platform C++20/C++23 module-only library with many useful features. Just drag and drop! It's that easy.

# How to use
1. Make sure you set your compiler's language standard to C++20/C++23 or higher.
2. Clone the repository anywhere inside your project, for example, in a directory named `dependencies`.
```bash
MyProject\dependencies> git clone https://github.com/Beyondo/null
```
3. Enjoy using modules in C++!

**For Visual Studio:**
- Make sure to click on "Show All Files" icon then click on refresh icon.
- Right click on `dependencies` or `dependencies/null` directory and click "Include In Project".


# Importing notes
- All library modules are prefixed by `null.[module_name]`.
- All library modules are in the namespace `null::`.
- This library was coded so that Intellisense would always work fine with it.
# Available modules
- `null.filterable`
- `null.clipboard`
- `null.window`
- `null.graphics`
- `null.vulkan`
- `null.math`
- `null.meta`

# Notes:
If you found this library useful, or at least a good helpful example of how next-gen libraries of C++23 modules should be like, then pleaes consider starring it!
38 changes: 38 additions & 0 deletions modules/algorithm/alg_string.ixx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
export module null.algorithm.string;
import <vector>;
import <string>;
export namespace null
{
inline auto split(const std::string& str, char delim) -> std::vector<std::string>
{
std::vector<std::string> parts;
std::string part;
for (auto i = 0; i < str.length(); i++)
{
if (str[i] == delim)
{
parts.push_back(part);
part.clear();
}
else
part += str[i];
}
parts.push_back(part);
return parts;
}
inline void split(const std::string& str, char delim, std::vector<std::string>& parts)
{
std::string part;
for (auto i = 0; i < str.length(); i++)
{
if (str[i] == delim)
{
parts.push_back(part);
part.clear();
}
else
part += str[i];
}
parts.push_back(part);
}
}
Loading

0 comments on commit 2a6dc9b

Please sign in to comment.