Skip to content

Commit

Permalink
vector
Browse files Browse the repository at this point in the history
new class to replace remains c code style ...
  • Loading branch information
tnut committed Apr 23, 2024
1 parent c01247f commit e4914d7
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ include ../Makefile.inc
TOOLSOBJECTS = system_utils.o \
error_treat.o \
md5.o \
vector.o \
string_utils.o \
archive_utils.o \
file_utils.o \
Expand All @@ -44,6 +45,7 @@ CARDSOBJECTS = conf.o \
system_utils.o \
error_treat.o \
md5.o \
vector.o \
string_utils.o \
archive_utils.o \
pkg.o \
Expand Down Expand Up @@ -80,6 +82,7 @@ LIBOBJECTS = conf.o \
system_utils.o \
error_treat.o \
md5.o \
vector.o \
string_utils.o \
archive_utils.o \
pkgrepo.o \
Expand All @@ -102,6 +105,7 @@ WEBOBJECTS = conf.o \
system_utils.o \
error_treat.o \
md5.o \
vector.o \
file_utils.o \
string_utils.o \
pkgrepo.o \
Expand All @@ -115,6 +119,7 @@ HEADERS = enum.h \
system_utils.h \
error_treat.h \
md5.h \
vector.h \
string_utils.h \
file_utils.h \
archive_utils.h \
Expand Down
22 changes: 22 additions & 0 deletions src/vector.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include "vector.h"
namespace cards {
vector::vector() {
m_capacity = 15;
m_size = 1;

}
vector::vector(const unsigned int capacity){
m_capacity = capacity;
m_size = 1;
}
const unsigned int vector::size(){
return m_size;
}
const unsigned int vector::capacity(){
return m_capacity;
}

} // end of cards namespace

// vim:set ts=2 :

24 changes: 24 additions & 0 deletions src/vector.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#pragma once
namespace cards {

class vector
{
public:
vector();
vector(const unsigned int capacity);
~vector(){};

void push_back(const void * element);
const unsigned int size();
const unsigned int capacity();


private:
unsigned int m_capacity;
unsigned int m_size;

};
} // end of cards namespace

// vim:set ts=2 :

0 comments on commit e4914d7

Please sign in to comment.